Sha256: 28c5be9a557742b017c24c84f71bfdf860b6ac08688251c33f51e5940e5ad92b

Contents?: true

Size: 1.33 KB

Versions: 6

Compression:

Stored size: 1.33 KB

Contents

module Spaceship
  module Tunes
    class Territory < TunesBase
      # @return (String) The two-character country code (e.g. "US" for the United States)
      attr_accessor :code

      # @return (String) The ISO 3166-1 alpha-3 currency code (e.g. "USD" for the United States)
      attr_accessor :currency_code

      # @return (String) The country name (e.g. "United States" for the United States)
      attr_accessor :name

      # @return (String) The region (e.g. "The United States and Canada" for the United States)
      attr_accessor :region

      # @return (String) The region locale key (e.g. "ITC.region.NAM" for the United States)
      attr_accessor :region_locale_key

      attr_mapping(
        'code' => :code,
        'currencyCodeISO3A' => :currency_code,
        'name' => :name,
        'region' => :region,
        'regionLocaleKey' => :region_locale_key
      )

      class << self
        # Create a new object based on a hash.
        # This is used to create a new object based on the server response.
        def factory(attrs)
          obj = self.new(attrs)
          return obj
        end

        # Create a new object based on a two-character country code (e.g. "US" for the United States)
        def from_code(code)
          obj = self.new
          obj.code = code
          return obj
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fastlane-2.14.2 spaceship/lib/spaceship/tunes/territory.rb
fastlane-2.14.1 spaceship/lib/spaceship/tunes/territory.rb
fastlane-2.14.0 spaceship/lib/spaceship/tunes/territory.rb
fastlane-2.13.0 spaceship/lib/spaceship/tunes/territory.rb
fastlane-2.12.0 spaceship/lib/spaceship/tunes/territory.rb
fastlane-2.11.0 spaceship/lib/spaceship/tunes/territory.rb