Class: TMDBParty::Country

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/tmdb_party/country.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

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

#codeObject



20
21
22
# File 'lib/tmdb_party/country.rb', line 20

def code
  code_string.downcase.to_sym
end

#code_stringObject



5
# File 'lib/tmdb_party/country.rb', line 5

alias_method :code_string, :code