Class: Censys::Location
- Inherits:
-
Object
- Object
- Censys::Location
- Defined in:
- lib/censys/location.rb
Instance Attribute Summary collapse
- #city ⇒ String readonly
- #continent ⇒ String readonly
- #country ⇒ String readonly
- #country_code ⇒ String readonly
- #latitude ⇒ Float readonly
- #longitude ⇒ Float readonly
- #postal_code ⇒ String readonly
- #province ⇒ String readonly
- #registered_country ⇒ String readonly
- #registered_country_code ⇒ String readonly
- #timezone ⇒ String readonly
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Location
constructor
Initializes the location information.
Constructor Details
#initialize(attributes) ⇒ Location
Initializes the location information.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/censys/location.rb', line 43 def initialize(attributes) @attributes = attributes @city = self['city'] @continent = self['continent'] @country = self['country'] @country_code = self['country_code'] @latitude = self['latitude'] @longitude = self['longitude'] @postal_code = self['postal_code'] @province = self['province'] @registered_country = self['registered_country'] @registered_country_code = self['registered_country_code'] @timezone = self['timezone'] end |
Instance Attribute Details
#city ⇒ String (readonly)
9 10 11 |
# File 'lib/censys/location.rb', line 9 def city @city end |
#continent ⇒ String (readonly)
21 22 23 |
# File 'lib/censys/location.rb', line 21 def continent @continent end |
#country ⇒ String (readonly)
15 16 17 |
# File 'lib/censys/location.rb', line 15 def country @country end |
#country_code ⇒ String (readonly)
18 19 20 |
# File 'lib/censys/location.rb', line 18 def country_code @country_code end |
#latitude ⇒ Float (readonly)
33 34 35 |
# File 'lib/censys/location.rb', line 33 def latitude @latitude end |
#longitude ⇒ Float (readonly)
36 37 38 |
# File 'lib/censys/location.rb', line 36 def longitude @longitude end |
#postal_code ⇒ String (readonly)
6 7 8 |
# File 'lib/censys/location.rb', line 6 def postal_code @postal_code end |
#province ⇒ String (readonly)
12 13 14 |
# File 'lib/censys/location.rb', line 12 def province @province end |
#registered_country ⇒ String (readonly)
24 25 26 |
# File 'lib/censys/location.rb', line 24 def registered_country @registered_country end |
#registered_country_code ⇒ String (readonly)
27 28 29 |
# File 'lib/censys/location.rb', line 27 def registered_country_code @registered_country_code end |
#timezone ⇒ String (readonly)
30 31 32 |
# File 'lib/censys/location.rb', line 30 def timezone @timezone end |