Class: Runt::RSpec
Overview
TExpr that provides a thin wrapper around built-in Ruby Range
functionality facilitating inclusion of an arbitrary range in a temporal expression.
See also: Range
Instance Method Summary collapse
-
#include?(date_expr) ⇒ Boolean
Will return true if the supplied object is included in the range used to create this instance.
-
#initialize(date_expr) ⇒ RSpec
constructor
A new instance of RSpec.
- #to_s ⇒ Object
Methods inherited from TExpr
Constructor Details
#initialize(date_expr) ⇒ RSpec
Returns a new instance of RSpec.
192 193 194 195 |
# File 'lib/runt/temporalexpression.rb', line 192 def initialize(date_expr) raise TypeError, 'expected range' unless date_expr.kind_of?(Range) @date_expr = date_expr end |
Instance Method Details
#include?(date_expr) ⇒ Boolean
Will return true if the supplied object is included in the range used to create this instance
199 200 201 |
# File 'lib/runt/temporalexpression.rb', line 199 def include?(date_expr) return @date_expr.include?(date_expr) end |
#to_s ⇒ Object
203 |
# File 'lib/runt/temporalexpression.rb', line 203 def to_s; "RSpec" end |