Class: Runt::Spec

Inherits:
Object
  • Object
show all
Includes:
TExpr
Defined in:
lib/runt/temporalexpression.rb

Overview

TExpr that provides for inclusion of an arbitrary date.

Direct Known Subclasses

RSpec

Instance Attribute Summary collapse

Instance Method Summary collapse

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_exprObject (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

Returns:

  • (Boolean)


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_sObject



210
211
212
# File 'lib/runt/temporalexpression.rb', line 210

def to_s
  @date_expr.to_s
end