Class: Cadence::ExecutionOptions
- Inherits:
-
Object
- Object
- Cadence::ExecutionOptions
- Defined in:
- lib/cadence/execution_options.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#retry_policy ⇒ Object
readonly
Returns the value of attribute retry_policy.
-
#task_list ⇒ Object
readonly
Returns the value of attribute task_list.
-
#timeouts ⇒ Object
readonly
Returns the value of attribute timeouts.
Instance Method Summary collapse
-
#initialize(object, options = {}) ⇒ ExecutionOptions
constructor
A new instance of ExecutionOptions.
Constructor Details
#initialize(object, options = {}) ⇒ ExecutionOptions
Returns a new instance of ExecutionOptions.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/cadence/execution_options.rb', line 7 def initialize(object, = {}) @name = [:name] || object.to_s @domain = [:domain] @task_list = [:task_list] @retry_policy = [:retry_policy] @cron_schedule = [:cron_schedule] @timeouts = [:timeouts] || {} @headers = [:headers] || {} if object.singleton_class.included_modules.include?(Concerns::Executable) @domain ||= object.domain @task_list ||= object.task_list @retry_policy ||= object.retry_policy @timeouts = object.timeouts.merge(@timeouts) if object.timeouts @headers = object.headers.merge(@headers) if object.headers end @domain ||= Cadence.configuration.domain @task_list ||= Cadence.configuration.task_list @timeouts = Cadence.configuration.timeouts.merge(@timeouts) @headers = Cadence.configuration.headers.merge(@headers) freeze end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
5 6 7 |
# File 'lib/cadence/execution_options.rb', line 5 def domain @domain end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/cadence/execution_options.rb', line 5 def headers @headers end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/cadence/execution_options.rb', line 5 def name @name end |
#retry_policy ⇒ Object (readonly)
Returns the value of attribute retry_policy.
5 6 7 |
# File 'lib/cadence/execution_options.rb', line 5 def retry_policy @retry_policy end |
#task_list ⇒ Object (readonly)
Returns the value of attribute task_list.
5 6 7 |
# File 'lib/cadence/execution_options.rb', line 5 def task_list @task_list end |
#timeouts ⇒ Object (readonly)
Returns the value of attribute timeouts.
5 6 7 |
# File 'lib/cadence/execution_options.rb', line 5 def timeouts @timeouts end |