Class: DataScienceTheater3000::Ip2Coordinates
- Inherits:
-
Object
- Object
- DataScienceTheater3000::Ip2Coordinates
- Defined in:
- lib/data_science_theater_3000/ip2coordinates.rb
Instance Attribute Summary collapse
- #ip ⇒ Object private
Instance Method Summary collapse
-
#initialize(ip) ⇒ Ip2Coordinates
constructor
Converts a ip addresses into a location hash.
- #result ⇒ Hash
Constructor Details
#initialize(ip) ⇒ Ip2Coordinates
Converts a ip addresses into a location hash
11 12 13 14 |
# File 'lib/data_science_theater_3000/ip2coordinates.rb', line 11 def initialize ip @ip = CGI::escape(ip) if ip.is_a?(String) @ip = ActiveSupport::JSON.encode(ip.map!{|a|CGI::escape(a)}) if ip.is_a?(Array) end |
Instance Attribute Details
#ip ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 |
# File 'lib/data_science_theater_3000/ip2coordinates.rb', line 5 def ip @ip end |
Instance Method Details
#result ⇒ Hash
18 19 20 |
# File 'lib/data_science_theater_3000/ip2coordinates.rb', line 18 def result dst_request.result end |