Method: HelloSign::Resource::BaseResource#method_missing

Defined in:
lib/hello_sign/resource/base_resource.rb

#method_missing(method) ⇒ Object

Magic method, gives class dynamic methods based on hash keys. If initialized hash has a key which matches the method name, return value of that key. Otherwise, return nil.

Examples:

resource = BaseResource.new email_address: "[email protected]"
resource.email_address => "[email protected]"
resource.not_in_hash_keys => nil

Parameters:

  • method (Symbol)

    Method’s name



68
69
70
# File 'lib/hello_sign/resource/base_resource.rb', line 68

def method_missing(method)
  @data.key?(method.to_s) ? @data[method.to_s] : nil
end