Class: Rtype::RtypeComponent
Instance Attribute Summary collapse
-
#annotation_mode ⇒ Object
Returns the value of attribute annotation_mode.
-
#annotation_type_sig ⇒ Object
Returns the value of attribute annotation_type_sig.
-
#ignoring ⇒ Object
Returns the value of attribute ignoring.
-
#old_methods ⇒ Object
readonly
Returns the value of attribute old_methods.
-
#undef_methods ⇒ Object
readonly
Returns the value of attribute undef_methods.
Instance Method Summary collapse
- #add_undef(name, expected_args, return_sig, singleton) ⇒ Object
- #get_old(name, singleton) ⇒ Object
- #get_undef(name, singleton) ⇒ Object
- #has_old?(name, singleton) ⇒ Boolean
- #has_undef?(name, singleton) ⇒ Boolean
-
#initialize ⇒ RtypeComponent
constructor
A new instance of RtypeComponent.
- #remove_undef(name, singleton) ⇒ Object
- #set_old(name, singleton, method) ⇒ Object
Constructor Details
#initialize ⇒ RtypeComponent
Returns a new instance of RtypeComponent.
6 7 8 9 10 11 12 |
# File 'lib/rtype/rtype_component.rb', line 6 def initialize @annotation_mode = false @annotation_type_sig = nil @ignoring = false @undef_methods = {} @old_methods = {} end |
Instance Attribute Details
#annotation_mode ⇒ Object
Returns the value of attribute annotation_mode.
3 4 5 |
# File 'lib/rtype/rtype_component.rb', line 3 def annotation_mode @annotation_mode end |
#annotation_type_sig ⇒ Object
Returns the value of attribute annotation_type_sig.
3 4 5 |
# File 'lib/rtype/rtype_component.rb', line 3 def annotation_type_sig @annotation_type_sig end |
#ignoring ⇒ Object
Returns the value of attribute ignoring.
3 4 5 |
# File 'lib/rtype/rtype_component.rb', line 3 def ignoring @ignoring end |
#old_methods ⇒ Object (readonly)
Returns the value of attribute old_methods.
4 5 6 |
# File 'lib/rtype/rtype_component.rb', line 4 def old_methods @old_methods end |
#undef_methods ⇒ Object (readonly)
Returns the value of attribute undef_methods.
4 5 6 |
# File 'lib/rtype/rtype_component.rb', line 4 def undef_methods @undef_methods end |
Instance Method Details
#add_undef(name, expected_args, return_sig, singleton) ⇒ Object
31 32 33 34 35 |
# 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) ⇒ Object
19 20 21 |
# File 'lib/rtype/rtype_component.rb', line 19 def get_old(name, singleton) @old_methods[singleton][name] end |
#get_undef(name, singleton) ⇒ Object
45 46 47 |
# File 'lib/rtype/rtype_component.rb', line 45 def get_undef(name, singleton) @undef_methods[singleton][name] end |
#has_old?(name, singleton) ⇒ Boolean
23 24 25 |
# 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) ⇒ Boolean
37 38 39 |
# 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) ⇒ Object
41 42 43 |
# File 'lib/rtype/rtype_component.rb', line 41 def remove_undef(name, singleton) @undef_methods[singleton].delete(name) end |
#set_old(name, singleton, method) ⇒ Object
14 15 16 17 |
# File 'lib/rtype/rtype_component.rb', line 14 def set_old(name, singleton, method) @old_methods[singleton] ||= {} @old_methods[singleton][name] = method end |