Class: IsoCountry::Country

Inherits:
Object
  • Object
show all
Defined in:
lib/iso_countries_plus/country.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#alpha2Object

Returns the value of attribute alpha2.



4
5
6
# File 'lib/iso_countries_plus/country.rb', line 4

def alpha2
  @alpha2
end

#alpha3Object

Returns the value of attribute alpha3.



4
5
6
# File 'lib/iso_countries_plus/country.rb', line 4

def alpha3
  @alpha3
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/iso_countries_plus/country.rb', line 4

def name
  @name
end