Class: Miasma::Models::Orchestration::Stack::Events
- Inherits:
-
Types::Collection
- Object
- Types::Collection
- Miasma::Models::Orchestration::Stack::Events
- Defined in:
- lib/miasma/models/orchestration/events.rb
Overview
Abstract stack resources collection
Instance Attribute Summary (collapse)
-
- (Miasma::Api) api
inherited
from Types::Collection
readonly
Underlying service API.
- - (Miasma::Models::Orchestration::Stack) stack readonly
Instance Method Summary (collapse)
-
- (Event) build(args = {})
Build a new event instance.
-
- (Array<Event>) filter(options = {})
Return events matching given filter.
-
- (Events) initialize(stack)
constructor
Override to capture originating stack.
-
- (Event) model
Collection item class.
-
- (Array<Event>) update!
Fetch any new events and add to collection.
Constructor Details
- (Events) initialize(stack)
Override to capture originating stack
17 18 19 20 |
# File 'lib/miasma/models/orchestration/events.rb', line 17 def initialize(stack) @stack = stack super stack.api end |
Instance Attribute Details
- (Miasma::Api) api (readonly) Originally defined in class Types::Collection
Returns underlying service API
- (Miasma::Models::Orchestration::Stack) stack (readonly)
12 13 14 |
# File 'lib/miasma/models/orchestration/events.rb', line 12 def stack @stack end |
Instance Method Details
- (Event) build(args = {})
Build a new event instance
34 35 36 |
# File 'lib/miasma/models/orchestration/events.rb', line 34 def build(args={}) Event.new(stack, args.to_smash) end |
- (Array<Event>) filter(options = {})
Return events matching given filter
26 27 28 |
# File 'lib/miasma/models/orchestration/events.rb', line 26 def filter(={}) raise NotImplementedError end |
- (Event) model
Returns collection item class
39 40 41 |
# File 'lib/miasma/models/orchestration/events.rb', line 39 def model Event end |
- (Array<Event>) update!
Fetch any new events and add to collection
46 47 48 49 50 |
# File 'lib/miasma/models/orchestration/events.rb', line 46 def update! new_events = api.event_all_new(self) self.all += new_events new_events end |