Class: Seira::Jobs
- Inherits:
-
Object
- Object
- Seira::Jobs
- Defined in:
- lib/seira/jobs.rb
Constant Summary collapse
- VALID_ACTIONS =
%w[help list delete run].freeze
- SUMMARY =
"Manage your application's jobs.".freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#job_name ⇒ Object
readonly
Returns the value of attribute job_name.
Instance Method Summary collapse
-
#initialize(app:, action:, args:, context:) ⇒ Jobs
constructor
A new instance of Jobs.
- #run ⇒ Object
Constructor Details
#initialize(app:, action:, args:, context:) ⇒ Jobs
Returns a new instance of Jobs.
10 11 12 13 14 15 16 |
# File 'lib/seira/jobs.rb', line 10 def initialize(app:, action:, args:, context:) @app = app @action = action @context = context @args = args @job_name = args[0] end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'lib/seira/jobs.rb', line 8 def action @action end |
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/seira/jobs.rb', line 8 def app @app end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/seira/jobs.rb', line 8 def args @args end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
8 9 10 |
# File 'lib/seira/jobs.rb', line 8 def context @context end |
#job_name ⇒ Object (readonly)
Returns the value of attribute job_name.
8 9 10 |
# File 'lib/seira/jobs.rb', line 8 def job_name @job_name end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/seira/jobs.rb', line 18 def run case action when 'help' run_help when 'list' run_list when 'delete' run_delete when 'run' run_run else fail "Unknown command encountered" end end |