Class: Telize::Client
- Inherits:
-
Object
- Object
- Telize::Client
- Defined in:
- lib/telize/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #geoip(ip_address = nil) ⇒ Object
-
#initialize(config = Config.new) ⇒ Client
constructor
A new instance of Client.
- #ip ⇒ Object
Constructor Details
#initialize(config = Config.new) ⇒ Client
Returns a new instance of Client.
7 8 9 |
# File 'lib/telize/client.rb', line 7 def initialize(config = Config.new) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/telize/client.rb', line 5 def config @config end |
Instance Method Details
#geoip(ip_address = nil) ⇒ Object
15 16 17 |
# File 'lib/telize/client.rb', line 15 def geoip(ip_address = nil) perform(['', 'geoip', ip_address].compact.join(?/)) end |
#ip ⇒ Object
11 12 13 |
# File 'lib/telize/client.rb', line 11 def ip perform('/jsonip')['ip'] end |