Class: Spaceship::Tunes::Territory

Inherits:
TunesBase show all
Defined in:
spaceship/lib/spaceship/tunes/territory.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, #attributes, attributes, factory, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#codeString

Returns The two-character country code (e.g. “US” for the United States).

Returns:

  • (String)

    The two-character country code (e.g. “US” for the United States)


7
8
9
# File 'spaceship/lib/spaceship/tunes/territory.rb', line 7

def code
  @code
end

#currency_codeString

Returns The ISO 3166-1 alpha-3 currency code (e.g. “USD” for the United States).

Returns:

  • (String)

    The ISO 3166-1 alpha-3 currency code (e.g. “USD” for the United States)


10
11
12
# File 'spaceship/lib/spaceship/tunes/territory.rb', line 10

def currency_code
  @currency_code
end

#nameString

Returns The country name (e.g. “United States” for the United States).

Returns:

  • (String)

    The country name (e.g. “United States” for the United States)


13
14
15
# File 'spaceship/lib/spaceship/tunes/territory.rb', line 13

def name
  @name
end

#regionString

Returns The region (e.g. “The United States and Canada” for the United States).

Returns:

  • (String)

    The region (e.g. “The United States and Canada” for the United States)


16
17
18
# File 'spaceship/lib/spaceship/tunes/territory.rb', line 16

def region
  @region
end

#region_locale_keyString

Returns The region locale key (e.g. “ITC.region.NAM” for the United States).

Returns:

  • (String)

    The region locale key (e.g. “ITC.region.NAM” for the United States)


19
20
21
# File 'spaceship/lib/spaceship/tunes/territory.rb', line 19

def region_locale_key
  @region_locale_key
end

Class Method Details

.from_code(code) ⇒ Object

Create a new object based on a two-character country code (e.g. “US” for the United States)


31
32
33
34
35
# File 'spaceship/lib/spaceship/tunes/territory.rb', line 31

def from_code(code)
  obj = self.new
  obj.code = code
  return obj
end