Class: Cronjobs::DSL::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/cronjobs/dsl/actions.rb

Instance Method Summary collapse

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_aObject



18
19
20
# File 'lib/cronjobs/dsl/actions.rb', line 18

def to_a
  @actions
end