Class: Cronjobs::DSL::Actions
- Inherits:
-
Object
- Object
- Cronjobs::DSL::Actions
- Defined in:
- lib/cronjobs/dsl/actions.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ Actions
constructor
A new instance of Actions.
- #rake(task) ⇒ Object
- #runner(command) ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(&block) ⇒ Actions
Returns a new instance of Actions.
5 6 7 8 |
# File 'lib/cronjobs/dsl/actions.rb', line 5 def initialize(&block) @actions = [] instance_eval(&block) end |
Instance Method Details
#rake(task) ⇒ Object
14 15 16 |
# File 'lib/cronjobs/dsl/actions.rb', line 14 def rake(task) @actions << "./bin/rake #{task}" end |
#runner(command) ⇒ Object
10 11 12 |
# File 'lib/cronjobs/dsl/actions.rb', line 10 def runner(command) @actions << "./bin/rails runner '#{command}'" end |
#to_a ⇒ Object
18 19 20 |
# File 'lib/cronjobs/dsl/actions.rb', line 18 def to_a @actions end |