Class: EbDeployer::CfEventSource
- Inherits:
-
Object
- Object
- EbDeployer::CfEventSource
- Defined in:
- lib/eb_deployer/cf_event_source.rb
Instance Method Summary collapse
- #fetch_events(from_anchor, &block) ⇒ Object
- #get_anchor ⇒ Object
-
#initialize(stack_name, cf_driver) ⇒ CfEventSource
constructor
A new instance of CfEventSource.
Constructor Details
#initialize(stack_name, cf_driver) ⇒ CfEventSource
Returns a new instance of CfEventSource.
3 4 5 6 |
# File 'lib/eb_deployer/cf_event_source.rb', line 3 def initialize(stack_name, cf_driver) @stack_name = stack_name @cf_driver = cf_driver end |
Instance Method Details
#fetch_events(from_anchor, &block) ⇒ Object
13 14 15 16 17 |
# File 'lib/eb_deployer/cf_event_source.rb', line 13 def fetch_events(from_anchor, &block) events, next_token = @cf_driver.fetch_events(@stack_name) should_continue = yield(events) fetch_next(next_token, &block) if next_token && should_continue end |
#get_anchor ⇒ Object
8 9 10 11 |
# File 'lib/eb_deployer/cf_event_source.rb', line 8 def get_anchor events, _ = @cf_driver.fetch_events(@stack_name) events.first end |