Class: ConceptQL::DateAdjuster

Inherits:
Object
  • Object
show all
Defined in:
lib/conceptql/date_adjuster.rb

Overview

Used to translate a string of terse date adjustments into a set of adjustments that are compatible with most RDBMSs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ DateAdjuster



7
8
9
# File 'lib/conceptql/date_adjuster.rb', line 7

def initialize(str)
  @str = str
end

Instance Attribute Details

#strObject (readonly)

Returns the value of attribute str.



6
7
8
# File 'lib/conceptql/date_adjuster.rb', line 6

def str
  @str
end

Instance Method Details

#adjustmentsObject

Returns an array of strings that represent date modifiers



12
13
14
# File 'lib/conceptql/date_adjuster.rb', line 12

def adjustments
  @adjustments ||= parse(str)
end