Class: Sensis::ResponseData

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

Overview

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object (private)



151
152
153
154
155
156
157
158
159
160
# File 'lib/sensis.rb', line 151

def method_missing(*args)
  name = args[0].to_s
  return self[name] if has_key? name
  camelname = name.split('_').map {|w| "#{w[0,1].upcase}#{w[1..-1]}" }.join("")
  if has_key? camelname
    self[camelname]
  else
    super *args
  end
end