Class: IP2Country::Country
- Inherits:
-
Object
- Object
- IP2Country::Country
- Defined in:
- lib/ip2country/country.rb
Overview
IP2Country represents a country of a matching IP returned by IP2Country#lookup.
Instance Attribute Summary collapse
-
#cc ⇒ Object
(also: #code2, #country_code2)
readonly
Returns the value of attribute cc.
-
#ccc ⇒ Object
(also: #code3, #country_code3)
readonly
Returns the value of attribute ccc.
-
#name ⇒ Object
(also: #country_name)
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(cc, ccc, name) ⇒ Country
constructor
A new instance of Country.
Constructor Details
#initialize(cc, ccc, name) ⇒ Country
6 7 8 9 10 |
# File 'lib/ip2country/country.rb', line 6 def initialize(cc, ccc, name) @cc = cc.to_s @ccc = ccc.to_s @name = name.to_s end |
Instance Attribute Details
#cc ⇒ Object (readonly) Also known as: code2, country_code2
Returns the value of attribute cc.
4 5 6 |
# File 'lib/ip2country/country.rb', line 4 def cc @cc end |
#ccc ⇒ Object (readonly) Also known as: code3, country_code3
Returns the value of attribute ccc.
4 5 6 |
# File 'lib/ip2country/country.rb', line 4 def ccc @ccc end |
#name ⇒ Object (readonly) Also known as: country_name
Returns the value of attribute name.
4 5 6 |
# File 'lib/ip2country/country.rb', line 4 def name @name end |