Class: MethodArgs::MethodRegistry
- Inherits:
-
Hash
- Object
- Hash
- MethodArgs::MethodRegistry
- Defined in:
- lib/method_args/method_registry.rb
Instance Attribute Summary collapse
-
#method_names ⇒ Object
readonly
Returns the value of attribute method_names.
Instance Method Summary collapse
- #add_methods!(methods) ⇒ Object
-
#initialize ⇒ MethodRegistry
constructor
A new instance of MethodRegistry.
Constructor Details
#initialize ⇒ MethodRegistry
Returns a new instance of MethodRegistry.
5 6 7 8 |
# File 'lib/method_args/method_registry.rb', line 5 def initialize super @method_names = [] end |
Instance Attribute Details
#method_names ⇒ Object (readonly)
Returns the value of attribute method_names.
3 4 5 |
# File 'lib/method_args/method_registry.rb', line 3 def method_names @method_names end |
Instance Method Details
#add_methods!(methods) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/method_args/method_registry.rb', line 10 def add_methods!(methods) methods.each do |(method_name, args)| unless key?(method_name) self[method_name] = args method_names << method_name end end end |