Class: JobWorkflow::Schedule
- Inherits:
-
Object
- Object
- JobWorkflow::Schedule
- Defined in:
- lib/job_workflow/schedule.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
: Hash[Symbol, untyped].
-
#class_name ⇒ Object
readonly
: String.
-
#description ⇒ Object
readonly
: String?.
-
#expression ⇒ Object
readonly
: String.
-
#key ⇒ Object
readonly
: Symbol.
-
#priority ⇒ Object
readonly
: Integer?.
-
#queue ⇒ Object
readonly
: String?.
Instance Method Summary collapse
-
#initialize(expression:, class_name:, key: nil, queue: nil, priority: nil, args: {}, description: nil) ⇒ Schedule
constructor
rubocop:disable Metrics/ParameterLists : ( expression: String, class_name: String, ?key: (String | Symbol)?, ?queue: String?, ?priority: Integer?, ?args: Hash[Symbol, untyped], ?description: String? ) -> void.
-
#to_config ⇒ Object
: () -> Hash[Symbol, untyped].
Constructor Details
#initialize(expression:, class_name:, key: nil, queue: nil, priority: nil, args: {}, description: nil) ⇒ Schedule
rubocop:disable Metrics/ParameterLists : (
expression: String,
class_name: String,
?key: (String | Symbol)?,
?queue: String?,
?priority: Integer?,
?args: Hash[Symbol, untyped],
?description: String?
) -> void
23 24 25 26 27 28 29 30 31 |
# File 'lib/job_workflow/schedule.rb', line 23 def initialize(expression:, class_name:, key: nil, queue: nil, priority: nil, args: {}, description: nil) @expression = expression #: String @class_name = class_name #: String @key = (key || class_name).to_sym #: Symbol @queue = queue #: String? @priority = priority #: Integer? @args = args #: Hash[Symbol, untyped] @description = description #: String? end |
Instance Attribute Details
#args ⇒ Object (readonly)
: Hash[Symbol, untyped]
10 11 12 |
# File 'lib/job_workflow/schedule.rb', line 10 def args @args end |
#class_name ⇒ Object (readonly)
: String
6 7 8 |
# File 'lib/job_workflow/schedule.rb', line 6 def class_name @class_name end |
#description ⇒ Object (readonly)
: String?
11 12 13 |
# File 'lib/job_workflow/schedule.rb', line 11 def description @description end |
#expression ⇒ Object (readonly)
: String
7 8 9 |
# File 'lib/job_workflow/schedule.rb', line 7 def expression @expression end |
#key ⇒ Object (readonly)
: Symbol
5 6 7 |
# File 'lib/job_workflow/schedule.rb', line 5 def key @key end |
#priority ⇒ Object (readonly)
: Integer?
9 10 11 |
# File 'lib/job_workflow/schedule.rb', line 9 def priority @priority end |
#queue ⇒ Object (readonly)
: String?
8 9 10 |
# File 'lib/job_workflow/schedule.rb', line 8 def queue @queue end |
Instance Method Details
#to_config ⇒ Object
: () -> Hash[Symbol, untyped]
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/job_workflow/schedule.rb', line 35 def to_config { class: class_name, schedule: expression, queue: queue, priority: priority, args: args.empty? ? nil : [args], description: description }.compact end |