Class: Android::Publisher::Edit
- Inherits:
-
Object
- Object
- Android::Publisher::Edit
- Defined in:
- lib/android/publisher/edit.rb
Constant Summary collapse
- ENDPOINT =
"edits"
Instance Method Summary collapse
- #assign_to_alpha_track ⇒ Object
- #assign_to_beta_track ⇒ Object
- #assign_to_production_track ⇒ Object
- #assign_to_staged_rollout_track(user_fraction) ⇒ Object
- #clear_beta ⇒ Object
- #clear_rollout ⇒ Object
- #commit ⇒ Object
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(connection, version_code) ⇒ Edit
constructor
A new instance of Edit.
- #insert ⇒ Object
- #track_has_deployed_apks?(track) ⇒ Boolean
- #update_rollout(user_fraction) ⇒ Object
- #upload_apk(path_to_apk) ⇒ Object
Constructor Details
Instance Method Details
#assign_to_alpha_track ⇒ Object
46 47 48 |
# File 'lib/android/publisher/edit.rb', line 46 def assign_to_alpha_track Track.new(@client, :alpha).update(version_code) end |
#assign_to_beta_track ⇒ Object
50 51 52 |
# File 'lib/android/publisher/edit.rb', line 50 def assign_to_beta_track Track.new(@client, :beta).update(version_code) end |
#assign_to_production_track ⇒ Object
54 55 56 |
# File 'lib/android/publisher/edit.rb', line 54 def assign_to_production_track Track.new(@client, :production).update(version_code) end |
#assign_to_staged_rollout_track(user_fraction) ⇒ Object
58 59 60 |
# File 'lib/android/publisher/edit.rb', line 58 def assign_to_staged_rollout_track(user_fraction) Track.new(@client, :rollout).update(version_code, user_fraction) end |
#clear_beta ⇒ Object
70 71 72 |
# File 'lib/android/publisher/edit.rb', line 70 def clear_beta Track.new(@client, :beta).update(nil) end |
#clear_rollout ⇒ Object
66 67 68 |
# File 'lib/android/publisher/edit.rb', line 66 def clear_rollout Track.new(@client, :rollout).update(nil) end |
#commit ⇒ Object
22 23 24 25 26 |
# File 'lib/android/publisher/edit.rb', line 22 def commit response = connection.commit reset_status response end |
#delete ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/android/publisher/edit.rb', line 28 def delete if (id) response = Response.parse(@client.delete) reset_status response else raise "Edit is not created, please insert one" end end |
#get ⇒ Object
18 19 20 |
# File 'lib/android/publisher/edit.rb', line 18 def get Response.parse(@client.get) end |
#insert ⇒ Object
11 12 13 14 15 16 |
# File 'lib/android/publisher/edit.rb', line 11 def insert response = Response.parse(@client.post) @id = response['id'] @client = @client.add_endpoint(id) response end |
#track_has_deployed_apks?(track) ⇒ Boolean
38 39 40 |
# File 'lib/android/publisher/edit.rb', line 38 def track_has_deployed_apks?(track) Track.new(@client, track).has_deployed_apks? end |
#update_rollout(user_fraction) ⇒ Object
62 63 64 |
# File 'lib/android/publisher/edit.rb', line 62 def update_rollout(user_fraction) Track.new(@client, :rollout).patch(version_code, user_fraction) end |
#upload_apk(path_to_apk) ⇒ Object
42 43 44 |
# File 'lib/android/publisher/edit.rb', line 42 def upload_apk(path_to_apk) apks.upload(path_to_apk) end |