Class: Runt::Spec
- Inherits:
-
Object
- Object
- Runt::Spec
- 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
-
#include?(date_expr) ⇒ Boolean
Will return true if the supplied object is == to that which was used to create this instance.
-
#initialize(date_expr) ⇒ Spec
constructor
A new instance of Spec.
- #to_s ⇒ Object
Methods included from TExpr
#&, #-, #and, #dates, #minus, #or, #|
Constructor Details
#initialize(date_expr) ⇒ Spec
Returns a new instance of Spec.
198 199 200 |
# File 'lib/runt/temporalexpression.rb', line 198 def initialize(date_expr) @date_expr = date_expr end |
Instance Attribute Details
#date_expr ⇒ Object (readonly)
Returns the value of attribute date_expr.
196 197 198 |
# File 'lib/runt/temporalexpression.rb', line 196 def date_expr @date_expr end |
Instance Method Details
#include?(date_expr) ⇒ Boolean
Will return true if the supplied object is == to that which was used to create this instance
204 205 206 207 208 |
# File 'lib/runt/temporalexpression.rb', line 204 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
210 211 212 |
# File 'lib/runt/temporalexpression.rb', line 210 def to_s @date_expr.to_s end |