Class: Decoder::Countries
- Inherits:
-
Object
- Object
- Decoder::Countries
- Defined in:
- lib/decoder/countries.rb
Class Method Summary collapse
Instance Method Summary collapse
- #[](_code) ⇒ Object
- #countries ⇒ Object
- #countries=(_countries) ⇒ Object
-
#initialize ⇒ Countries
constructor
A new instance of Countries.
- #inspect ⇒ Object
Constructor Details
Class Method Details
.[](_code) ⇒ Object
26 27 28 |
# File 'lib/decoder/countries.rb', line 26 def self.[](_code) self.new[_code] end |
Instance Method Details
#[](_code) ⇒ Object
20 21 22 23 24 |
# File 'lib/decoder/countries.rb', line 20 def [](_code) _code = _code.to_s.upcase country = countries[_code] Decoder::Country.new(:code => _code, :name => country[:name]) end |
#countries ⇒ Object
16 17 18 |
# File 'lib/decoder/countries.rb', line 16 def countries @countries end |
#countries=(_countries) ⇒ Object
12 13 14 |
# File 'lib/decoder/countries.rb', line 12 def countries=(_countries) @countries = _countries end |
#inspect ⇒ Object
8 9 10 |
# File 'lib/decoder/countries.rb', line 8 def inspect %{#<#{self.class}>} end |