Class: IPinfo::Response
- Inherits:
-
Object
- Object
- IPinfo::Response
- Defined in:
- lib/ipinfo/response.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ipinfo/response.rb', line 9 def initialize(response) @all = response @all.each do |name, value| instance_variable_set("@#{name}", value) c = class << self; self end c.send(:attr_accessor, name) end end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
7 8 9 |
# File 'lib/ipinfo/response.rb', line 7 def all @all end |