class Rtype::RtypeComponent

Attributes

annotation_mode[RW]
annotation_type_sig[RW]
ignoring[RW]
old_methods[R]
undef_methods[R]

Public Class Methods

new() click to toggle source
# File lib/rtype/rtype_component.rb, line 6
def initialize
        @annotation_mode = false
        @annotation_type_sig = nil
        @ignoring = false
        @undef_methods = {}
        @old_methods = {}
end

Public Instance Methods

add_undef(name, expected_args, return_sig, singleton) click to toggle source

@param [Symbol] name @param [Array] expected_args @param return_sig @param [Boolean] singleton

# File lib/rtype/rtype_component.rb, line 31
def add_undef(name, expected_args, return_sig, singleton)
        obj = { expected: expected_args, result: return_sig }
        @undef_methods[singleton] ||= {}
        @undef_methods[singleton][name] = obj
end
get_old(name, singleton) click to toggle source
# File lib/rtype/rtype_component.rb, line 19
def get_old(name, singleton)
        @old_methods[singleton][name]
end
get_undef(name, singleton) click to toggle source
# File lib/rtype/rtype_component.rb, line 45
def get_undef(name, singleton)
        @undef_methods[singleton][name]
end
has_old?(name, singleton) click to toggle source
# File lib/rtype/rtype_component.rb, line 23
def has_old?(name, singleton)
        @old_methods.key?(singleton) && @old_methods[singleton].key?(name)
end
has_undef?(name, singleton) click to toggle source
# File lib/rtype/rtype_component.rb, line 37
def has_undef?(name, singleton)
        @undef_methods.key?(singleton) && @undef_methods[singleton].key?(name)
end
remove_undef(name, singleton) click to toggle source
# File lib/rtype/rtype_component.rb, line 41
def remove_undef(name, singleton)
        @undef_methods[singleton].delete(name)
end
set_old(name, singleton, method) click to toggle source
# File lib/rtype/rtype_component.rb, line 14
def set_old(name, singleton, method)
        @old_methods[singleton] ||= {}
        @old_methods[singleton][name] = method
end