Class: Spaceship::Tunes::AppVersion
- Defined in:
- lib/spaceship/tunes/app_version.rb
Overview
Represents an editable version of an iTunes Connect Application This can either be the live or the edit version retrieved via the app
Instance Attribute Summary collapse
-
#app_icon_original_name ⇒ String
Name of the original file.
-
#app_icon_url ⇒ String
URL to the full resolution 1024x1024 app icon.
-
#app_status ⇒ Spaceship::Tunes::AppStatus
readonly
What’s the current status of this app e.g.
-
#application ⇒ Spaceship::Tunes::Application
A reference to the application this version is for.
- #can_beta_test ⇒ Bool
- #can_prepare_for_upload ⇒ Bool
- #can_reject_version ⇒ Bool
- #can_send_version_live ⇒ Bool
-
#copyright ⇒ String
The copyright information of this app.
-
#description ⇒ Hash
readonly
A hash representing the description in all languages.
-
#is_live ⇒ Bool
Is that the version that’s currently available in the App Store?.
-
#keywords ⇒ Hash
readonly
A hash representing the keywords in all languages.
-
#languages ⇒ Array
Raw access the all available languages.
-
#marketing_url ⇒ Hash
readonly
A hash representing the keywords in all 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 keywords in all languages.
-
#raw_status ⇒ String
App Status (e.g. ‘readyForSale’).
-
#release_notes ⇒ Hash
readonly
The changelog.
-
#release_on_approval ⇒ Object
These methods takes care of properly parsing values that are not returned in the right format, e.g.
-
#review_demo_password ⇒ String
App Review Information Demo Account Password.
-
#review_demo_user ⇒ String
App Review Information Demo Account User Name.
-
#review_email ⇒ String
App Review Information Email Address.
-
#review_first_name ⇒ String
App Review Information.
-
#review_last_name ⇒ String
App Review Information Last Name.
-
#review_notes ⇒ String
App Review Information Notes.
-
#review_phone_number ⇒ String
App Review Information Phone Number.
-
#screenshots ⇒ Hash
readonly
Represents the screenshots of this app version (read-only).
-
#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.
-
#support_url ⇒ Hash
readonly
A hash representing the keywords in all languages.
-
#supports_apple_watch ⇒ Bool
Does the binary contain a watch binary?.
-
#version ⇒ String
The version number of this version.
-
#version_id ⇒ Integer
A unqiue ID for this version generated by iTunes Connect.
-
#watch_app_icon_original_name ⇒ String
Name of the original file.
-
#watch_app_icon_url ⇒ String
URL to the full resolution 1024x1024 app icon.
Attributes inherited from Base
Class Method Summary collapse
-
.factory(attrs) ⇒ Object
Create a new object based on a hash.
- .find(application, app_id, is_live = false) ⇒ Object
Instance Method Summary collapse
-
#is_live? ⇒ Bool
Is that version currently available in the App Store?.
-
#save! ⇒ Object
Push all changes that were made back to iTunes Connect.
-
#setup ⇒ Object
Private methods.
-
#unfold_languages ⇒ Object
Prefill name, keywords, etc…
-
#url ⇒ String
An URL to this specific resource.
Methods inherited from TunesBase
Methods inherited from Base
attr_accessor, attr_mapping, attributes, #attributes, #client, #initialize, #inspect, mapping_module, method_missing, set_client, #to_s
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#app_icon_original_name ⇒ String
Returns Name of the original file.
61 62 63 |
# File 'lib/spaceship/tunes/app_version.rb', line 61 def app_icon_original_name @app_icon_original_name end |
#app_icon_url ⇒ String
Returns URL to the full resolution 1024x1024 app icon.
58 59 60 |
# File 'lib/spaceship/tunes/app_version.rb', line 58 def app_icon_url @app_icon_url end |
#app_status ⇒ Spaceship::Tunes::AppStatus (readonly)
Returns What’s the current status of this app e.g. Waiting for Review, Ready for Sale, …
18 19 20 |
# File 'lib/spaceship/tunes/app_version.rb', line 18 def app_status @app_status end |
#application ⇒ Spaceship::Tunes::Application
Returns A reference to the application this version is for.
8 9 10 |
# File 'lib/spaceship/tunes/app_version.rb', line 8 def application @application end |
#can_beta_test ⇒ Bool
52 53 54 |
# File 'lib/spaceship/tunes/app_version.rb', line 52 def can_beta_test @can_beta_test end |
#can_prepare_for_upload ⇒ Bool
43 44 45 |
# File 'lib/spaceship/tunes/app_version.rb', line 43 def can_prepare_for_upload @can_prepare_for_upload end |
#can_reject_version ⇒ Bool
40 41 42 |
# File 'lib/spaceship/tunes/app_version.rb', line 40 def can_reject_version @can_reject_version end |
#can_send_version_live ⇒ Bool
46 47 48 |
# File 'lib/spaceship/tunes/app_version.rb', line 46 def can_send_version_live @can_send_version_live end |
#copyright ⇒ String
Returns The copyright information of this app.
14 15 16 |
# File 'lib/spaceship/tunes/app_version.rb', line 14 def copyright @copyright end |
#description ⇒ Hash (readonly)
Returns A hash representing the description in all languages.
110 111 112 |
# File 'lib/spaceship/tunes/app_version.rb', line 110 def description @description end |
#is_live ⇒ Bool
Returns Is that the version that’s currently available in the App Store?.
21 22 23 |
# File 'lib/spaceship/tunes/app_version.rb', line 21 def is_live @is_live end |
#keywords ⇒ Hash (readonly)
Returns A hash representing the keywords in all languages.
107 108 109 |
# File 'lib/spaceship/tunes/app_version.rb', line 107 def keywords @keywords end |
#languages ⇒ Array
Returns Raw access the all available languages. You shouldn’t use it probbaly.
101 102 103 |
# File 'lib/spaceship/tunes/app_version.rb', line 101 def languages @languages end |
#marketing_url ⇒ Hash (readonly)
Returns A hash representing the keywords in all languages.
122 123 124 |
# File 'lib/spaceship/tunes/app_version.rb', line 122 def marketing_url @marketing_url end |
#name ⇒ Hash (readonly)
Returns A hash representing the app name in all languages.
104 105 106 |
# File 'lib/spaceship/tunes/app_version.rb', line 104 def name @name end |
#primary_category ⇒ Object
Categories (e.g. MZGenre.Business)
24 25 26 |
# File 'lib/spaceship/tunes/app_version.rb', line 24 def primary_category @primary_category end |
#primary_first_sub_category ⇒ Object
Returns the value of attribute primary_first_sub_category.
26 27 28 |
# File 'lib/spaceship/tunes/app_version.rb', line 26 def primary_first_sub_category @primary_first_sub_category end |
#primary_second_sub_category ⇒ Object
Returns the value of attribute primary_second_sub_category.
28 29 30 |
# File 'lib/spaceship/tunes/app_version.rb', line 28 def primary_second_sub_category @primary_second_sub_category end |
#privacy_url ⇒ Hash (readonly)
Returns A hash representing the keywords in all languages.
116 117 118 |
# File 'lib/spaceship/tunes/app_version.rb', line 116 def privacy_url @privacy_url end |
#raw_status ⇒ String
Returns App Status (e.g. ‘readyForSale’). You should use ‘app_status` instead.
37 38 39 |
# File 'lib/spaceship/tunes/app_version.rb', line 37 def raw_status @raw_status end |
#release_notes ⇒ Hash (readonly)
Returns The changelog.
113 114 115 |
# File 'lib/spaceship/tunes/app_version.rb', line 113 def release_notes @release_notes end |
#release_on_approval ⇒ Object
These methods takes care of properly parsing values that are not returned in the right format, e.g. boolean as string
49 50 51 |
# File 'lib/spaceship/tunes/app_version.rb', line 49 def release_on_approval @release_on_approval end |
#review_demo_password ⇒ String
Returns App Review Information Demo Account Password.
91 92 93 |
# File 'lib/spaceship/tunes/app_version.rb', line 91 def review_demo_password @review_demo_password end |
#review_demo_user ⇒ String
Returns App Review Information Demo Account User Name.
88 89 90 |
# File 'lib/spaceship/tunes/app_version.rb', line 88 def review_demo_user @review_demo_user end |
#review_email ⇒ String
Returns App Review Information Email Address.
85 86 87 |
# File 'lib/spaceship/tunes/app_version.rb', line 85 def review_email @review_email end |
#review_first_name ⇒ String
App Review Information
76 77 78 |
# File 'lib/spaceship/tunes/app_version.rb', line 76 def review_first_name @review_first_name end |
#review_last_name ⇒ String
Returns App Review Information Last Name.
79 80 81 |
# File 'lib/spaceship/tunes/app_version.rb', line 79 def review_last_name @review_last_name end |
#review_notes ⇒ String
Returns App Review Information Notes.
94 95 96 |
# File 'lib/spaceship/tunes/app_version.rb', line 94 def review_notes @review_notes end |
#review_phone_number ⇒ String
Returns App Review Information Phone Number.
82 83 84 |
# File 'lib/spaceship/tunes/app_version.rb', line 82 def review_phone_number @review_phone_number end |
#screenshots ⇒ Hash (readonly)
Returns Represents the screenshots of this app version (read-only).
125 126 127 |
# File 'lib/spaceship/tunes/app_version.rb', line 125 def screenshots @screenshots end |
#secondary_category ⇒ Object
Returns the value of attribute secondary_category.
30 31 32 |
# File 'lib/spaceship/tunes/app_version.rb', line 30 def secondary_category @secondary_category end |
#secondary_first_sub_category ⇒ Object
Returns the value of attribute secondary_first_sub_category.
32 33 34 |
# File 'lib/spaceship/tunes/app_version.rb', line 32 def secondary_first_sub_category @secondary_first_sub_category end |
#secondary_second_sub_category ⇒ Object
Returns the value of attribute secondary_second_sub_category.
34 35 36 |
# File 'lib/spaceship/tunes/app_version.rb', line 34 def secondary_second_sub_category @secondary_second_sub_category end |
#support_url ⇒ Hash (readonly)
Returns A hash representing the keywords in all languages.
119 120 121 |
# File 'lib/spaceship/tunes/app_version.rb', line 119 def support_url @support_url end |
#supports_apple_watch ⇒ Bool
Returns Does the binary contain a watch binary?.
55 56 57 |
# File 'lib/spaceship/tunes/app_version.rb', line 55 def supports_apple_watch @supports_apple_watch end |
#version ⇒ String
Returns The version number of this version.
11 12 13 |
# File 'lib/spaceship/tunes/app_version.rb', line 11 def version @version end |
#version_id ⇒ Integer
Returns a unqiue ID for this version generated by iTunes Connect.
70 71 72 |
# File 'lib/spaceship/tunes/app_version.rb', line 70 def version_id @version_id end |
#watch_app_icon_original_name ⇒ String
Returns Name of the original file.
67 68 69 |
# File 'lib/spaceship/tunes/app_version.rb', line 67 def watch_app_icon_original_name @watch_app_icon_original_name end |
#watch_app_icon_url ⇒ String
Returns URL to the full resolution 1024x1024 app icon.
64 65 66 |
# File 'lib/spaceship/tunes/app_version.rb', line 64 def watch_app_icon_url @watch_app_icon_url 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.
164 165 166 167 168 169 170 |
# File 'lib/spaceship/tunes/app_version.rb', line 164 def factory(attrs) orig = attrs.dup obj = self.new(attrs) obj.unfold_languages return obj end |
.find(application, app_id, is_live = false) ⇒ Object
175 176 177 178 179 180 181 |
# File 'lib/spaceship/tunes/app_version.rb', line 175 def find(application, app_id, is_live = false) attrs = client.app_version(app_id, is_live) attrs.merge!(application: application) attrs.merge!(is_live: is_live) return self.factory(attrs) end |
Instance Method Details
#is_live? ⇒ Bool
Returns Is that version currently available in the App Store?.
185 186 187 |
# File 'lib/spaceship/tunes/app_version.rb', line 185 def is_live? is_live end |
#save! ⇒ Object
Push all changes that were made back to iTunes Connect
223 224 225 |
# File 'lib/spaceship/tunes/app_version.rb', line 223 def save! client.update_app_version!(application.apple_id, is_live?, raw_data) end |
#setup ⇒ Object
Private methods
234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/spaceship/tunes/app_version.rb', line 234 def setup # Properly parse the AppStatus status = raw_data['status'] @app_status = Tunes::AppStatus.get_from_string(status) # Setup the screenshots @screenshots = {} raw_data['details']['value'].each do |row| # Now that's one language right here @screenshots[row['language']] = setup_screenshots(row) end end |
#unfold_languages ⇒ Object
Prefill name, keywords, etc…
249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/spaceship/tunes/app_version.rb', line 249 def unfold_languages { name: :name, keywords: :keywords, description: :description, privacyURL: :privacy_url, supportURL: :support_url, marketingURL: :marketing_url, releaseNotes: :release_notes }.each do |json, attribute| instance_variable_set("@#{attribute}".to_sym, LanguageItem.new(json, languages)) end end |
#url ⇒ String
Returns An URL to this specific resource. You can enter this URL into your browser.
228 229 230 |
# File 'lib/spaceship/tunes/app_version.rb', line 228 def url "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/#{self.application.apple_id}/" + (self.is_live? ? "cur" : "") end |