Class: TimePatterns::IntervalTimeEndingPattern

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

#initializeIntervalTimeEndingPattern

Returns a new instance of IntervalTimeEndingPattern.



140
141
142
# File 'lib/todo_time_patterns/time_patterns.rb', line 140

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

Instance Method Details

#valid?(tokens_quadruple) ⇒ Boolean

Returns:

  • (Boolean)


144
145
146
# File 'lib/todo_time_patterns/time_patterns.rb', line 144

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