Class: Spaceship::Tunes::IAPList

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

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Instance 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

#app_maximum_number_of_codesObject

Returns the value of attribute app_maximum_number_of_codes.



27
28
29
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 27

def app_maximum_number_of_codes
  @app_maximum_number_of_codes
end

#applicationSpaceship::Tunes::Application

Returns A reference to the application.

Returns:



9
10
11
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 9

def application
  @application
end

#can_delete_addonObject

Returns the value of attribute can_delete_addon.



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

def can_delete_addon
  @can_delete_addon
end

#duration_daysObject

Returns the value of attribute duration_days.



20
21
22
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 20

def duration_days
  @duration_days
end

#family_reference_nameString

Returns Family Reference Name.

Returns:

  • (String)

    Family Reference Name



18
19
20
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 18

def family_reference_name
  @family_reference_name
end

#is_editableObject

Returns the value of attribute is_editable.



28
29
30
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 28

def is_editable
  @is_editable
end

#is_news_subscriptionObject

Returns the value of attribute is_news_subscription.



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

def is_news_subscription
  @is_news_subscription
end

#is_requiredObject

Returns the value of attribute is_required.



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

def is_required
  @is_required
end

#last_modified_dateObject

Returns the value of attribute last_modified_date.



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

def last_modified_date
  @last_modified_date
end

#maximum_number_of_codesObject

Returns the value of attribute maximum_number_of_codes.



26
27
28
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 26

def maximum_number_of_codes
  @maximum_number_of_codes
end

#number_of_codesObject

Returns the value of attribute number_of_codes.



25
26
27
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 25

def number_of_codes
  @number_of_codes
end

#product_idString

Returns the IAP Product-Id.

Returns:

  • (String)

    the IAP Product-Id



15
16
17
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 15

def product_id
  @product_id
end

#purple_apple_idObject

Returns the value of attribute purple_apple_id.



22
23
24
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 22

def purple_apple_id
  @purple_apple_id
end

#reference_nameString

Returns the IAP Referencename.

Returns:

  • (String)

    the IAP Referencename



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

def reference_name
  @reference_name
end

#versionsObject

Returns the value of attribute versions.



21
22
23
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 21

def versions
  @versions
end

Instance Method Details

#delete!Object



71
72
73
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 71

def delete!
  client.delete_iap!(app_id: application.apple_id, purchase_id: self.purchase_id)
end

#editObject



58
59
60
61
62
63
64
65
66
67
68
69
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 58

def edit
  attrs = client.load_iap(app_id: application.apple_id, purchase_id: self.purchase_id)
  attrs[:application] = application

  if attrs["addOnType"] == Spaceship::Tunes::IAPType::RECURRING
    raw_pricing_data = client.load_recurring_iap_pricing(app_id: application.apple_id,
                                                         purchase_id: self.purchase_id)
    attrs["pricingData"] = raw_pricing_data
  end

  Tunes::IAPDetail.new(attrs)
end

#statusObject



54
55
56
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 54

def status
  Tunes::IAPStatus.get_from_string(raw_data["iTunesConnectStatus"])
end

#typeObject



50
51
52
# File 'spaceship/lib/spaceship/tunes/iap_list.rb', line 50

def type
  Tunes::IAPType.get_from_string(raw_data["addOnType"])
end