Class: Spaceship::Tunes::AppVersionGeneratedPromocodes

Inherits:
TunesBase
  • Object
show all
Defined in:
lib/spaceship/tunes/app_version_generated_promocodes.rb

Overview

Represents the information about the generation of promocodes

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

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

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#codesObject (readonly)

Array of String



12
13
14
# File 'lib/spaceship/tunes/app_version_generated_promocodes.rb', line 12

def codes
  @codes
end

#effective_dateObject (readonly)

Returns:



6
7
8
# File 'lib/spaceship/tunes/app_version_generated_promocodes.rb', line 6

def effective_date
  @effective_date
end

#expiration_dateObject (readonly)

Returns the value of attribute expiration_date.



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

def expiration_date
  @expiration_date
end

#usernameObject (readonly)

Returns the value of attribute username.



8
9
10
# File 'lib/spaceship/tunes/app_version_generated_promocodes.rb', line 8

def username
  @username
end

#versionObject (readonly)

the AppVersionPromocodes this relates to



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

def version
  @version
end

Class Method Details

.factory(attrs) ⇒ Object

Create a new object based on a hash. This is used to create a new object based on the server response.



23
24
25
26
# File 'lib/spaceship/tunes/app_version_generated_promocodes.rb', line 23

def factory(attrs)
  obj = self.new(attrs)
  return obj
end

Instance Method Details

#setupObject



29
30
31
32
# File 'lib/spaceship/tunes/app_version_generated_promocodes.rb', line 29

def setup
  @version = Tunes::AppVersionPromocodes.factory(raw_data['version'])
  @codes = raw_data['codes']
end