Class: SampleModels::AttributeSequence::SimpleSource
- Inherits:
-
AbstractSource
- Object
- AbstractSource
- SampleModels::AttributeSequence::SimpleSource
- Defined in:
- lib/sample_models/attribute_sequence.rb
Instance Method Summary collapse
-
#initialize(column) ⇒ SimpleSource
constructor
A new instance of SimpleSource.
- #value ⇒ Object
Methods inherited from AbstractSource
Constructor Details
#initialize(column) ⇒ SimpleSource
Returns a new instance of SimpleSource.
152 153 154 155 |
# File 'lib/sample_models/attribute_sequence.rb', line 152 def initialize(column) super() @column = column end |
Instance Method Details
#value ⇒ Object
157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/sample_models/attribute_sequence.rb', line 157 def value case @column.type when :string, :text "#{@column.name} #{@number}" when :integer @number when :datetime Time.now.utc - @number.minutes when :date Date.today - @number when :float @number.to_f end end |