Class: NaturalDateExpression::DateMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/natural-date/natural_date_expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(match, first_matched_expression, tested_date, reference_date) ⇒ DateMatch

Returns a new instance of DateMatch.



7
8
9
10
11
12
# File 'lib/natural-date/natural_date_expression.rb', line 7

def initialize match, first_matched_expression, tested_date, reference_date
  @match = match
  @first_matched_expression = first_matched_expression
  @tested_date = tested_date
  @reference_date = reference_date
end

Instance Attribute Details

#first_matched_expressionObject (readonly)

Returns the value of attribute first_matched_expression.



5
6
7
# File 'lib/natural-date/natural_date_expression.rb', line 5

def first_matched_expression
  @first_matched_expression
end

#reference_dateObject (readonly)

Returns the value of attribute reference_date.



5
6
7
# File 'lib/natural-date/natural_date_expression.rb', line 5

def reference_date
  @reference_date
end

#tested_dateObject (readonly)

Returns the value of attribute tested_date.



5
6
7
# File 'lib/natural-date/natural_date_expression.rb', line 5

def tested_date
  @tested_date
end

Instance Method Details

#matches?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/natural-date/natural_date_expression.rb', line 14

def matches?
  @match
end