Class: TimePatterns::IntervalEndingPattern

Inherits:
TimePattern
  • Object
show all
Defined in:
lib/todo_time_patterns/time_patterns.rb

Instance Method Summary collapse

Methods inherited from TimePattern

#find_and_update

Constructor Details

#initializeIntervalEndingPattern

Returns a new instance of IntervalEndingPattern.



130
131
132
# File 'lib/todo_time_patterns/time_patterns.rb', line 130

def initialize
  super(%w[{word} {time} {word} {interval}], IntervalEndingToken)
end

Instance Method Details

#valid?(tokens_quadruple) ⇒ Boolean

Returns:

  • (Boolean)


134
135
136
# File 'lib/todo_time_patterns/time_patterns.rb', line 134

def valid?(tokens_quadruple)
  tokens_quadruple[0].value == "at" and tokens_quadruple[2].value == "for"
end