Sha256: 3e00219f85e9acf4bf4588c66b55c5a2e5881434cb6c729e12e597ba486f5fd2

Contents?: true

Size: 463 Bytes

Versions: 5

Compression:

Stored size: 463 Bytes

Contents

module TMDBParty
  class Country
    include Attributes
    attributes :name, :code, :url
    alias_method :code_string, :code
    
    def self.parse(data)
      return unless data
      if data.is_a?(Array)
        data.map { |row| Country.new(row) }
      else
        [Country.new(data)]
      end
    end
    
    def initialize(attributes)
      self.attributes = attributes
    end
    
    def code
      code_string.downcase.to_sym
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tmdb_party-0.9.0 lib/tmdb_party/country.rb
tmdb_party-0.8.0 lib/tmdb_party/country.rb
tmdb_party-0.7.0 lib/tmdb_party/country.rb
tmdb_party-0.6.0 lib/tmdb_party/country.rb
tmdb_party-0.5.0 lib/tmdb_party/country.rb