Class: Spaceship::Tunes::AppDetails
- Defined in:
- spaceship/lib/spaceship/tunes/app_details.rb
Instance Attribute Summary collapse
-
#apple_tv_privacy_policy ⇒ Hash
readonly
A hash prepresenting the privacy URL in all languages for Apple TV.
-
#application ⇒ Object
Returns the value of attribute application.
-
#available_primary_locale_codes ⇒ Object
Returns the value of attribute available_primary_locale_codes.
-
#languages ⇒ Array
Raw access the all available languages.
-
#name ⇒ Hash
readonly
A hash representing the app name in all languages.
-
#primary_category ⇒ Object
Categories (e.g. MZGenre.Business).
-
#primary_first_sub_category ⇒ Object
Returns the value of attribute primary_first_sub_category.
-
#primary_locale_code ⇒ Object
Returns the value of attribute primary_locale_code.
-
#primary_second_sub_category ⇒ Object
Returns the value of attribute primary_second_sub_category.
-
#privacy_url ⇒ Hash
readonly
A hash representing the privacy URL in all languages.
-
#secondary_category ⇒ Object
Returns the value of attribute secondary_category.
-
#secondary_first_sub_category ⇒ Object
Returns the value of attribute secondary_first_sub_category.
-
#secondary_second_sub_category ⇒ Object
Returns the value of attribute secondary_second_sub_category.
-
#subtitle ⇒ Hash
readonly
A hash representing the subtitle in all languages.
Attributes inherited from Base
General collapse
Class Method Summary collapse
-
.factory(attrs) ⇒ Object
Create a new object based on a hash.
Instance Method Summary collapse
-
#save! ⇒ Object
Push all changes that were made back to App Store Connect.
-
#unfold_languages ⇒ Object
Prefill name, privacy url.
Methods inherited from TunesBase
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
#apple_tv_privacy_policy ⇒ Hash (readonly)
Returns A hash prepresenting the privacy URL in all languages for Apple TV.
27 28 29 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 27 def apple_tv_privacy_policy @apple_tv_privacy_policy end |
#application ⇒ Object
Returns the value of attribute application.
8 9 10 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 8 def application @application end |
#available_primary_locale_codes ⇒ Object
Returns the value of attribute available_primary_locale_codes.
44 45 46 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 44 def available_primary_locale_codes @available_primary_locale_codes end |
#languages ⇒ Array
Returns Raw access the all available languages. You shouldn’t use it probbaly.
15 16 17 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 15 def languages @languages end |
#name ⇒ Hash (readonly)
Returns A hash representing the app name in all languages.
18 19 20 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 18 def name @name end |
#primary_category ⇒ Object
Categories (e.g. MZGenre.Business)
30 31 32 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 30 def primary_category @primary_category end |
#primary_first_sub_category ⇒ Object
Returns the value of attribute primary_first_sub_category.
32 33 34 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 32 def primary_first_sub_category @primary_first_sub_category end |
#primary_locale_code ⇒ Object
Returns the value of attribute primary_locale_code.
42 43 44 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 42 def primary_locale_code @primary_locale_code end |
#primary_second_sub_category ⇒ Object
Returns the value of attribute primary_second_sub_category.
34 35 36 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 34 def primary_second_sub_category @primary_second_sub_category end |
#privacy_url ⇒ Hash (readonly)
Returns A hash representing the privacy URL in all languages.
24 25 26 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 24 def privacy_url @privacy_url end |
#secondary_category ⇒ Object
Returns the value of attribute secondary_category.
36 37 38 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 36 def secondary_category @secondary_category end |
#secondary_first_sub_category ⇒ Object
Returns the value of attribute secondary_first_sub_category.
38 39 40 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 38 def secondary_first_sub_category @secondary_first_sub_category end |
#secondary_second_sub_category ⇒ Object
Returns the value of attribute secondary_second_sub_category.
40 41 42 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 40 def secondary_second_sub_category @secondary_second_sub_category end |
#subtitle ⇒ Hash (readonly)
Returns A hash representing the subtitle in all languages.
21 22 23 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 21 def subtitle @subtitle 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.
61 62 63 64 65 66 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 61 def factory(attrs) obj = self.new(attrs) obj.unfold_languages return obj end |
Instance Method Details
#save! ⇒ Object
Push all changes that were made back to App Store Connect
82 83 84 85 86 87 88 89 90 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 82 def save! client.update_app_details!(application.apple_id, raw_data) rescue Spaceship::Tunes::Error => ex if ex.to_s == "operation_failed" # That's alright, we get this error message if nothing has changed else raise ex end end |
#setup ⇒ Object
133 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 133 def setup; end |
#unfold_languages ⇒ Object
Prefill name, privacy url
70 71 72 73 74 75 76 77 78 79 |
# File 'spaceship/lib/spaceship/tunes/app_details.rb', line 70 def unfold_languages { name: :name, subtitle: :subtitle, privacyPolicyUrl: :privacy_url, privacyPolicy: :apple_tv_privacy_policy }.each do |json, attribute| instance_variable_set("@#{attribute}".to_sym, LanguageItem.new(json, languages)) end end |