Class: Spaceship::Tunes::AppDetails
- Defined in:
- lib/spaceship/tunes/app_details.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#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_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
#application ⇒ Object
Returns the value of attribute application.
4 5 6 |
# File 'lib/spaceship/tunes/app_details.rb', line 4 def application @application 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)
20 21 22 |
# File 'lib/spaceship/tunes/app_details.rb', line 20 def primary_category @primary_category end |
#primary_first_sub_category ⇒ Object
Returns the value of attribute primary_first_sub_category.
22 23 24 |
# File 'lib/spaceship/tunes/app_details.rb', line 22 def primary_first_sub_category @primary_first_sub_category end |
#primary_second_sub_category ⇒ Object
Returns the value of attribute primary_second_sub_category.
24 25 26 |
# File 'lib/spaceship/tunes/app_details.rb', line 24 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.
26 27 28 |
# File 'lib/spaceship/tunes/app_details.rb', line 26 def secondary_category @secondary_category end |
#secondary_first_sub_category ⇒ Object
Returns the value of attribute secondary_first_sub_category.
28 29 30 |
# File 'lib/spaceship/tunes/app_details.rb', line 28 def secondary_first_sub_category @secondary_first_sub_category end |
#secondary_second_sub_category ⇒ Object
Returns the value of attribute secondary_second_sub_category.
30 31 32 |
# File 'lib/spaceship/tunes/app_details.rb', line 30 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.
45 46 47 48 49 50 |
# File 'lib/spaceship/tunes/app_details.rb', line 45 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
64 65 66 67 68 69 70 71 72 |
# File 'lib/spaceship/tunes/app_details.rb', line 64 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
109 110 |
# File 'lib/spaceship/tunes/app_details.rb', line 109 def setup end |
#unfold_languages ⇒ Object
Prefill name, privacy url
54 55 56 57 58 59 60 61 |
# File 'lib/spaceship/tunes/app_details.rb', line 54 def unfold_languages { name: :name, privacyPolicyUrl: :privacy_url }.each do |json, attribute| instance_variable_set("@#{attribute}".to_sym, LanguageItem.new(json, languages)) end end |