Class: Aaron::DSL

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDSL

Returns a new instance of DSL.



7
8
9
# File 'lib/aaron/dsl.rb', line 7

def initialize
  @scheduler = Scheduler.new
end

Instance Attribute Details

#schedulerObject (readonly)

Returns the value of attribute scheduler.



5
6
7
# File 'lib/aaron/dsl.rb', line 5

def scheduler
  @scheduler
end

Instance Method Details

#every(range, proc = nil, &block) ⇒ Object



11
12
13
14
# File 'lib/aaron/dsl.rb', line 11

def every range, proc = nil, &block
  scheduler << Task.new(range, proc, &block)
  scheduler
end

#exec(&block) ⇒ Object



16
17
18
19
# File 'lib/aaron/dsl.rb', line 16

def exec &block
  block.type = :exec
  block
end