Class: Spaceship::Tunes::AppDetails
- Defined in:
- lib/spaceship/tunes/app_details.rb
Instance Attribute Summary collapse
-
#apple_tv_privacy_policy ⇒ Hash
readonly
Some bla bla about privacy.
-
#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.
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 iTunes 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 Some bla bla about privacy.
20 21 22 |
# File 'lib/spaceship/tunes/app_details.rb', line 20 def apple_tv_privacy_policy @apple_tv_privacy_policy end |
#application ⇒ Object
Returns the value of attribute application.
4 5 6 |
# File 'lib/spaceship/tunes/app_details.rb', line 4 def application @application end |
#available_primary_locale_codes ⇒ Object
Returns the value of attribute available_primary_locale_codes.
37 38 39 |
# File 'lib/spaceship/tunes/app_details.rb', line 37 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.
11 12 13 |
# File 'lib/spaceship/tunes/app_details.rb', line 11 def languages @languages end |
#name ⇒ Hash (readonly)
Returns A hash representing the app name in all languages.
14 15 16 |
# File 'lib/spaceship/tunes/app_details.rb', line 14 def name @name end |
#primary_category ⇒ Object
Categories (e.g. MZGenre.Business)
23 24 25 |
# File 'lib/spaceship/tunes/app_details.rb', line 23 def primary_category @primary_category end |
#primary_first_sub_category ⇒ Object
Returns the value of attribute primary_first_sub_category.
25 26 27 |
# File 'lib/spaceship/tunes/app_details.rb', line 25 def primary_first_sub_category @primary_first_sub_category end |
#primary_locale_code ⇒ Object
Returns the value of attribute primary_locale_code.
35 36 37 |
# File 'lib/spaceship/tunes/app_details.rb', line 35 def primary_locale_code @primary_locale_code end |
#primary_second_sub_category ⇒ Object
Returns the value of attribute primary_second_sub_category.
27 28 29 |
# File 'lib/spaceship/tunes/app_details.rb', line 27 def primary_second_sub_category @primary_second_sub_category end |
#privacy_url ⇒ Hash (readonly)
Returns A hash representing the privacy URL in all languages.
17 18 19 |
# File 'lib/spaceship/tunes/app_details.rb', line 17 def privacy_url @privacy_url end |
#secondary_category ⇒ Object
Returns the value of attribute secondary_category.
29 30 31 |
# File 'lib/spaceship/tunes/app_details.rb', line 29 def secondary_category @secondary_category end |
#secondary_first_sub_category ⇒ Object
Returns the value of attribute secondary_first_sub_category.
31 32 33 |
# File 'lib/spaceship/tunes/app_details.rb', line 31 def secondary_first_sub_category @secondary_first_sub_category end |
#secondary_second_sub_category ⇒ Object
Returns the value of attribute secondary_second_sub_category.
33 34 35 |
# File 'lib/spaceship/tunes/app_details.rb', line 33 def secondary_second_sub_category @secondary_second_sub_category 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.
54 55 56 57 58 59 |
# File 'lib/spaceship/tunes/app_details.rb', line 54 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 iTunes Connect
74 75 76 77 78 79 80 81 82 |
# File 'lib/spaceship/tunes/app_details.rb', line 74 def save! client.update_app_details!(application.apple_id, raw_data) rescue Spaceship::TunesClient::ITunesConnectError => 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
125 |
# File 'lib/spaceship/tunes/app_details.rb', line 125 def setup; end |
#unfold_languages ⇒ Object
Prefill name, privacy url
63 64 65 66 67 68 69 70 71 |
# File 'lib/spaceship/tunes/app_details.rb', line 63 def unfold_languages { name: :name, privacyPolicyUrl: :privacy_url, privacyPolicy: :apple_tv_privacy_policy }.each do |json, attribute| instance_variable_set("@#{attribute}".to_sym, LanguageItem.new(json, languages)) end end |