Class: Pomodoro::Schedule::Thing

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

Direct Known Subclasses

Rule, Schedule

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, condition, &block) ⇒ Thing

Returns a new instance of Thing.


11
12
13
# File 'lib/pomodoro/schedule/dsl.rb', line 11

def initialize(name, condition, &block)
  @name, @condition, @callable = name, condition, block
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


10
11
12
# File 'lib/pomodoro/schedule/dsl.rb', line 10

def name
  @name
end

Instance Method Details

#call(tasks) ⇒ Object


19
20
21
# File 'lib/pomodoro/schedule/dsl.rb', line 19

def call(tasks)
  @callable.call(tasks)
end

#true?(*args) ⇒ Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/pomodoro/schedule/dsl.rb', line 15

def true?(*args)
  @condition.call(*args)
end