Class: IPis::Queries::IPApi
- Inherits:
-
Object
- Object
- IPis::Queries::IPApi
- Defined in:
- lib/ipis/queries/ip_api.rb
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
Instance Method Summary collapse
-
#initialize(ip) ⇒ IPApi
constructor
A new instance of IPApi.
- #result ⇒ Object
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
#ip ⇒ Object (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
#result ⇒ Object
9 10 11 |
# File 'lib/ipis/queries/ip_api.rb', line 9 def result @result ||= JSON.parse(request.to_s) end |