Class: Gaigo::Countries

Inherits:
Array
  • Object
show all
Defined in:
lib/gaigo/countries.rb

Defined Under Namespace

Classes: Country

Instance Method Summary collapse

Instance Method Details

#add_country(attributes) ⇒ Object



20
21
22
# File 'lib/gaigo/countries.rb', line 20

def add_country(attributes)
  self << Country.new(*attributes)
end

#codesObject



28
29
30
# File 'lib/gaigo/countries.rb', line 28

def codes
  self.map {|i| i.code}
end

#get(code) ⇒ Object



24
25
26
# File 'lib/gaigo/countries.rb', line 24

def get(code)
  self.find {|i| i.code == code.to_s}
end