Class: IPis::Queries::IPApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ipis/queries/ip_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip) ⇒ IPApi

Returns a new instance of IPApi.



5
6
7
# File 'lib/ipis/queries/ip_api.rb', line 5

def initialize(ip)
  @ip = ip
end

Instance Attribute Details

#ipObject (readonly)

Returns the value of attribute ip.



4
5
6
# File 'lib/ipis/queries/ip_api.rb', line 4

def ip
  @ip
end

Instance Method Details

#resultObject



9
10
11
# File 'lib/ipis/queries/ip_api.rb', line 9

def result
  @result ||= JSON.parse(request.to_s)
end