Class: IPinfo::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ipinfo/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#allObject (readonly)

Returns the value of attribute all.



7
8
9
# File 'lib/ipinfo/response.rb', line 7

def all
  @all
end