Class: LibTAD::Places::Country
- Inherits:
-
Object
- Object
- LibTAD::Places::Country
- Defined in:
- lib/types/places/country.rb
Overview
Information about a country.
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
The ISO 3166-1-alpha-2 country code.
-
#name ⇒ String
readonly
Full name of the country.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Country
constructor
A new instance of Country.
Constructor Details
#initialize(hash) ⇒ Country
Returns a new instance of Country.
14 15 16 17 |
# File 'lib/types/places/country.rb', line 14 def initialize(hash) @id = hash.fetch('id', nil) @name = hash.fetch('name', nil) end |
Instance Attribute Details
#id ⇒ String (readonly)
The ISO 3166-1-alpha-2 country code.
8 9 10 |
# File 'lib/types/places/country.rb', line 8 def id @id end |
#name ⇒ String (readonly)
Full name of the country.
12 13 14 |
# File 'lib/types/places/country.rb', line 12 def name @name end |