Class: Runt::TemporalDate
- Inherits:
-
Object
- Object
- Runt::TemporalDate
- Includes:
- TExpr
- Defined in:
- lib/runt/temporalexpression.rb
Overview
TExpr that provides for inclusion of an arbitrary date.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#date_expr ⇒ Object
readonly
Returns the value of attribute date_expr.
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#include?(date_expr) ⇒ Boolean
Will return true if the supplied object is == to that which was used to create this instance.
-
#initialize(date_expr) ⇒ TemporalDate
constructor
A new instance of TemporalDate.
- #to_s ⇒ Object
Methods included from TExpr
#&, #-, #and, #dates, #minus, #or, #|
Constructor Details
#initialize(date_expr) ⇒ TemporalDate
Returns a new instance of TemporalDate.
216 217 218 |
# File 'lib/runt/temporalexpression.rb', line 216 def initialize(date_expr) @date_expr = date_expr end |
Instance Attribute Details
#date_expr ⇒ Object (readonly)
Returns the value of attribute date_expr.
214 215 216 |
# File 'lib/runt/temporalexpression.rb', line 214 def date_expr @date_expr end |
Instance Method Details
#==(o) ⇒ Object
220 221 222 |
# File 'lib/runt/temporalexpression.rb', line 220 def ==(o) o.is_a?(TemporalDate) ? date_expr == o.date_expr : super(o) end |
#include?(date_expr) ⇒ Boolean
Will return true if the supplied object is == to that which was used to create this instance
226 227 228 229 230 |
# File 'lib/runt/temporalexpression.rb', line 226 def include?(date_expr) return date_expr.include?(@date_expr) if date_expr.respond_to?(:include?) return true if @date_expr == date_expr false end |
#to_s ⇒ Object
232 233 234 |
# File 'lib/runt/temporalexpression.rb', line 232 def to_s @date_expr.to_s end |