Class: ParametersExtra::MethodRegistry

Inherits:
Hash
  • Object
show all
Defined in:
lib/parameters_extra/method_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMethodRegistry

Returns a new instance of MethodRegistry.



5
6
7
8
# File 'lib/parameters_extra/method_registry.rb', line 5

def initialize
  super
  @method_names = []
end

Instance Attribute Details

#method_namesObject (readonly)

Returns the value of attribute method_names.



3
4
5
# File 'lib/parameters_extra/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/parameters_extra/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