Class: Geoplugin::Locate
- Inherits:
-
Object
- Object
- Geoplugin::Locate
- Defined in:
- lib/geoplugin/locate.rb
Instance Attribute Summary collapse
-
#areacode ⇒ Object
readonly
Returns the value of attribute areacode.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#continentcode ⇒ Object
readonly
Returns the value of attribute continentcode.
-
#countrycode ⇒ Object
readonly
Returns the value of attribute countrycode.
-
#countryname ⇒ Object
readonly
Returns the value of attribute countryname.
-
#currencycode ⇒ Object
readonly
Returns the value of attribute currencycode.
-
#currencyconverter ⇒ Object
readonly
Returns the value of attribute currencyconverter.
-
#currencysymbol ⇒ Object
readonly
Returns the value of attribute currencysymbol.
-
#currencysymbol_utf ⇒ Object
readonly
Returns the value of attribute currencysymbol_utf.
-
#dmacode ⇒ Object
readonly
Returns the value of attribute dmacode.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#regioncode ⇒ Object
readonly
Returns the value of attribute regioncode.
-
#regionname ⇒ Object
readonly
Returns the value of attribute regionname.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Locate
constructor
A new instance of Locate.
Constructor Details
#initialize(attributes) ⇒ Locate
Returns a new instance of Locate.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/geoplugin/locate.rb', line 29 def initialize(attributes) @request = attributes['geoplugin_request'] @status = attributes['geoplugin_status'] @city = attributes['geoplugin_city'] @region = attributes['geoplugin_region'] @areacode = attributes['geoplugin_areaCode'] @dmacode = attributes['geoplugin_dmaCode'] @countrycode = attributes['geoplugin_countryCode'] @countryname = attributes['geoplugin_countryName'] @continentcode = attributes['geoplugin_continentCode'] @latitude = attributes['geoplugin_latitude'] @longitude = attributes['geoplugin_longitude'] @regioncode = attributes['geoplugin_regionCode'] @regionname = attributes['geoplugin_regionName'] @currencycode = attributes['geoplugin_currencyCode'] @currencysymbol = attributes['geoplugin_currencySymbol'] @currencysymbol_utf = attributes['geoplugin_currencySymbol_UTF8'] @currencyconverter = attributes['geoplugin_currencyConverter'] end |
Instance Attribute Details
#areacode ⇒ Object (readonly)
Returns the value of attribute areacode.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def areacode @areacode end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def city @city end |
#continentcode ⇒ Object (readonly)
Returns the value of attribute continentcode.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def continentcode @continentcode end |
#countrycode ⇒ Object (readonly)
Returns the value of attribute countrycode.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def countrycode @countrycode end |
#countryname ⇒ Object (readonly)
Returns the value of attribute countryname.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def countryname @countryname end |
#currencycode ⇒ Object (readonly)
Returns the value of attribute currencycode.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def currencycode @currencycode end |
#currencyconverter ⇒ Object (readonly)
Returns the value of attribute currencyconverter.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def currencyconverter @currencyconverter end |
#currencysymbol ⇒ Object (readonly)
Returns the value of attribute currencysymbol.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def currencysymbol @currencysymbol end |
#currencysymbol_utf ⇒ Object (readonly)
Returns the value of attribute currencysymbol_utf.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def currencysymbol_utf @currencysymbol_utf end |
#dmacode ⇒ Object (readonly)
Returns the value of attribute dmacode.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def dmacode @dmacode end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def longitude @longitude end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def region @region end |
#regioncode ⇒ Object (readonly)
Returns the value of attribute regioncode.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def regioncode @regioncode end |
#regionname ⇒ Object (readonly)
Returns the value of attribute regionname.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def regionname @regionname end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def request @request end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/geoplugin/locate.rb', line 11 def status @status end |
Class Method Details
.locate(ip = nil, options) ⇒ Object
locate
50 51 52 53 |
# File 'lib/geoplugin/locate.rb', line 50 def self.locate(ip = nil, ) response = apiresponse(ip, ) new(response) unless response.empty? end |