Class: TMDBParty::Country
- Inherits:
-
Object
- Object
- TMDBParty::Country
- Includes:
- Attributes
- Defined in:
- lib/tmdb_party/country.rb
Class Method Summary collapse
Instance Method Summary collapse
- #code ⇒ Object
- #code_string ⇒ Object
-
#initialize(attributes) ⇒ Country
constructor
A new instance of Country.
Methods included from Attributes
Constructor Details
#initialize(attributes) ⇒ Country
Returns a new instance of Country.
16 17 18 |
# File 'lib/tmdb_party/country.rb', line 16 def initialize(attributes) self.attributes = attributes end |
Class Method Details
.parse(data) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/tmdb_party/country.rb', line 7 def self.parse(data) return unless data if data.is_a?(Array) data.map { |row| Country.new(row) } else [Country.new(data)] end end |
Instance Method Details
#code ⇒ Object
20 21 22 |
# File 'lib/tmdb_party/country.rb', line 20 def code code_string.downcase.to_sym end |
#code_string ⇒ Object
5 |
# File 'lib/tmdb_party/country.rb', line 5 alias_method :code_string, :code |