Module: NameDotComApi::Response::EigenMethodDefiner

Included in:
NameDotComApi::Response
Defined in:
lib/name_dot_com_api/response.rb

Overview

:nodoc:

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/name_dot_com_api/response.rb', line 11

def method_missing(name, *args, &block)
  if key?(name.to_s)
    define_eigen_method(name.to_s)
    value = self[name.to_s]
    value.extend(EigenMethodDefiner) if value.is_a?(Hash)
    value
  else
    super
  end
end