Class: AWSCDK::Triggers::TriggerOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Triggers::TriggerOptions
- Defined in:
- triggers/trigger_options.rb
Overview
Options for Trigger.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#execute_after ⇒ Array<Constructs::Construct>?
readonly
Adds trigger dependencies.
-
#execute_before ⇒ Array<Constructs::Construct>?
readonly
Adds this trigger as a dependency on other constructs.
-
#execute_on_handler_change ⇒ Boolean?
readonly
Re-executes the trigger every time the handler changes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil) ⇒ TriggerOptions
constructor
A new instance of TriggerOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil) ⇒ TriggerOptions
Returns a new instance of TriggerOptions.
10 11 12 13 14 15 16 17 |
# File 'triggers/trigger_options.rb', line 10 def initialize(execute_after: nil, execute_before: nil, execute_on_handler_change: nil) @execute_after = execute_after Jsii::Type.check_type(@execute_after, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImNvbnN0cnVjdHMuQ29uc3RydWN0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "executeAfter") unless @execute_after.nil? @execute_before = execute_before Jsii::Type.check_type(@execute_before, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImNvbnN0cnVjdHMuQ29uc3RydWN0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "executeBefore") unless @execute_before.nil? @execute_on_handler_change = execute_on_handler_change Jsii::Type.check_type(@execute_on_handler_change, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "executeOnHandlerChange") unless @execute_on_handler_change.nil? end |
Instance Attribute Details
#execute_after ⇒ Array<Constructs::Construct>? (readonly)
Default: []
Adds trigger dependencies. Execute this trigger only after these construct scopes have been provisioned.
You can also use trigger.executeAfter() to add additional dependencies.
25 26 27 |
# File 'triggers/trigger_options.rb', line 25 def execute_after @execute_after end |
#execute_before ⇒ Array<Constructs::Construct>? (readonly)
Default: []
Adds this trigger as a dependency on other constructs.
This means that this trigger will get executed before the given construct(s).
You can also use trigger.executeBefore() to add additional dependents.
35 36 37 |
# File 'triggers/trigger_options.rb', line 35 def execute_before @execute_before end |
#execute_on_handler_change ⇒ Boolean? (readonly)
Default: true
Re-executes the trigger every time the handler changes.
This implies that the trigger is associated with the current_version of
the handler, which gets recreated every time the handler or its
configuration is updated.
44 45 46 |
# File 'triggers/trigger_options.rb', line 44 def execute_on_handler_change @execute_on_handler_change end |
Class Method Details
.jsii_properties ⇒ Object
46 47 48 49 50 51 52 |
# File 'triggers/trigger_options.rb', line 46 def self.jsii_properties { :execute_after => "executeAfter", :execute_before => "executeBefore", :execute_on_handler_change => "executeOnHandlerChange", } end |
Instance Method Details
#to_jsii ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'triggers/trigger_options.rb', line 54 def to_jsii result = {} result.merge!({ "executeAfter" => @execute_after, "executeBefore" => @execute_before, "executeOnHandlerChange" => @execute_on_handler_change, }) result.compact end |