Class: DataIp
- Inherits:
-
Object
- Object
- DataIp
- Defined in:
- lib/DataIp.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#country_name ⇒ Object
Returns the value of attribute country_name.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#metro_code ⇒ Object
Returns the value of attribute metro_code.
-
#region_code ⇒ Object
Returns the value of attribute region_code.
-
#region_name ⇒ Object
Returns the value of attribute region_name.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#initialize(hash) ⇒ DataIp
constructor
A new instance of DataIp.
Constructor Details
#initialize(hash) ⇒ DataIp
Returns a new instance of DataIp.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/DataIp.rb', line 5 def initialize(hash) p hash @ip = hash["ip"] @country_name = hash["country_name"] @country_code = hash["country_code"] @region_code = hash["region_code"] @region_name = hash["region_name"] @city = hash["city"] @zip_code = hash["zip_code"] @time_zone = hash["time_zone"] @latitude = hash["latitude"] @longitude = hash["longitude"] @metro_code = hash["metro_code"] end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def city @city end |
#country_code ⇒ Object
Returns the value of attribute country_code.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def country_code @country_code end |
#country_name ⇒ Object
Returns the value of attribute country_name.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def country_name @country_name end |
#ip ⇒ Object
Returns the value of attribute ip.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def ip @ip end |
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def longitude @longitude end |
#metro_code ⇒ Object
Returns the value of attribute metro_code.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def metro_code @metro_code end |
#region_code ⇒ Object
Returns the value of attribute region_code.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def region_code @region_code end |
#region_name ⇒ Object
Returns the value of attribute region_name.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def region_name @region_name end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def time_zone @time_zone end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
3 4 5 |
# File 'lib/DataIp.rb', line 3 def zip_code @zip_code end |