Class: IsoCountry::Country
- Inherits:
-
Object
- Object
- IsoCountry::Country
- Defined in:
- lib/iso_countries_plus/country.rb
Instance Attribute Summary collapse
-
#alpha2 ⇒ Object
Returns the value of attribute alpha2.
-
#alpha3 ⇒ Object
Returns the value of attribute alpha3.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data) ⇒ Country
constructor
A new instance of Country.
Constructor Details
#initialize(data) ⇒ Country
Returns a new instance of Country.
6 7 8 9 10 |
# File 'lib/iso_countries_plus/country.rb', line 6 def initialize(data) data.each do |k, v| send(:"#{k}=", val) if self.respond_to? "#{k}=" end end |
Instance Attribute Details
#alpha2 ⇒ Object
Returns the value of attribute alpha2.
4 5 6 |
# File 'lib/iso_countries_plus/country.rb', line 4 def alpha2 @alpha2 end |
#alpha3 ⇒ Object
Returns the value of attribute alpha3.
4 5 6 |
# File 'lib/iso_countries_plus/country.rb', line 4 def alpha3 @alpha3 end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/iso_countries_plus/country.rb', line 4 def name @name end |