Method: MaxMind::Enquiry#method_missing

Defined in:
lib/max_mind/enquiry.rb

#method_missing(name, value = nil) ⇒ Object

 Set or get an attribute from the attributes hash or raise no method error if it doesn’t exist in our mapping.



54
55
56
57
58
# File 'lib/max_mind/enquiry.rb', line 54

def method_missing(name, value = nil)
  attribute_name = name.to_s.gsub(/\=\z/, '').to_sym
  return super unless mapping.keys.include?(attribute_name)
  value ? (attributes[attribute_name] = value) : attributes[attribute_name]
end