Class: HardCider::Client
- Inherits:
-
Object
- Object
- HardCider::Client
- Defined in:
- lib/hard_cider/client.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #latest_build(bundle_id) ⇒ Hash
- #latest_build_processed?(bundle_id) ⇒ String
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/hard_cider/client.rb', line 8 def initialize( = {}) @client = AppStoreConnect::Client.new() end |
Instance Method Details
#latest_build(bundle_id) ⇒ Hash
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/hard_cider/client.rb', line 14 def latest_build(bundle_id) response = @client.builds( limit: 1, filter: { app: app_id(bundle_id) } ) response.dig(:data, 0) end |
#latest_build_processed?(bundle_id) ⇒ String
27 28 29 30 31 |
# File 'lib/hard_cider/client.rb', line 27 def latest_build_processed?(bundle_id) processing_state = latest_build(bundle_id).dig(:attributes, :processing_state) processing_state == 'VALID' end |