Class: Spaceship::TestFlight::BuildTrains
- Defined in:
- spaceship/lib/spaceship/test_flight/build_trains.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.all(app_id: nil, platform: nil, retry_count: 3) ⇒ Object
BuildTrains represent the collection of builds for a ‘train_version`.
Instance Method Summary collapse
- #get(key) ⇒ Object (also: #[])
-
#initialize(trains = {}) ⇒ BuildTrains
constructor
A new instance of BuildTrains.
- #values ⇒ Object
- #versions ⇒ Object
Methods inherited from Base
Methods inherited from Base
attr_accessor, attr_mapping, attributes, #attributes, factory, #inspect, mapping_module, method_missing, set_client, #setup, #to_s
Constructor Details
#initialize(trains = {}) ⇒ BuildTrains
Returns a new instance of BuildTrains.
33 34 35 |
# File 'spaceship/lib/spaceship/test_flight/build_trains.rb', line 33 def initialize(trains = {}) @trains = trains end |
Class Method Details
.all(app_id: nil, platform: nil, retry_count: 3) ⇒ Object
BuildTrains represent the collection of builds for a ‘train_version`
Note: builds returned by BuildTrains are partially complete. Properties such as ‘exportCompliance`, `testInfo` and many others are not provided. It is the responsibility of Build to lazy-load the necessary properties.
See ‘Spaceship::TestFlight::Build#reload`
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'spaceship/lib/spaceship/test_flight/build_trains.rb', line 15 def self.all(app_id: nil, platform: nil, retry_count: 3) filter_platform = Spaceship::ConnectAPI::Platform.map(platform) if platform connect_builds = Spaceship::ConnectAPI::Build.all( app_id: app_id, sort: "uploadedDate", platform: filter_platform ) trains = {} connect_builds.each do |connect_build| train_version = connect_build.app_version trains[train_version] ||= [] trains[train_version] << connect_build.to_testflight_build end self.new(trains) end |
Instance Method Details
#get(key) ⇒ Object Also known as: []
37 38 39 |
# File 'spaceship/lib/spaceship/test_flight/build_trains.rb', line 37 def get(key) @trains[key] end |
#values ⇒ Object
42 43 44 |
# File 'spaceship/lib/spaceship/test_flight/build_trains.rb', line 42 def values @trains.values end |
#versions ⇒ Object
46 47 48 |
# File 'spaceship/lib/spaceship/test_flight/build_trains.rb', line 46 def versions @trains.keys end |