Method: SearchLingo::Parsers::DateParser#initialize
- Defined in:
- lib/search_lingo/parsers/date_parser.rb
#initialize(column, modifier: nil) ⇒ DateParser
Instantiates a new DateParser object.
The required argument column
should be an Arel attribute.
If present, the optional argument modifier
will be used as the operator which precedes the date term.
DateParser.new Booking.arel_table DateParser.new Contract.arel_table, modifier: ‘contract’
18 19 20 21 |
# File 'lib/search_lingo/parsers/date_parser.rb', line 18 def initialize(column, modifier: nil) @column = column @prefix = %r{#{modifier}:[[:space:]]*} if modifier end |