Class: Trifle::Ruby::Operations::Timeseries::Values
- Inherits:
-
Object
- Object
- Trifle::Ruby::Operations::Timeseries::Values
- Defined in:
- lib/trifle/ruby/operations/timeseries/values.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(**keywords) ⇒ Values
constructor
A new instance of Values.
- #perform ⇒ Object
- #timeline ⇒ Object
Constructor Details
#initialize(**keywords) ⇒ Values
Returns a new instance of Values.
10 11 12 13 14 15 16 |
# File 'lib/trifle/ruby/operations/timeseries/values.rb', line 10 def initialize(**keywords) @key = keywords.fetch(:key) @from = keywords.fetch(:from) @to = keywords.fetch(:to) @range = keywords.fetch(:range) @config = keywords[:config] end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/trifle/ruby/operations/timeseries/values.rb', line 8 def key @key end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
8 9 10 |
# File 'lib/trifle/ruby/operations/timeseries/values.rb', line 8 def range @range end |
Instance Method Details
#config ⇒ Object
18 19 20 |
# File 'lib/trifle/ruby/operations/timeseries/values.rb', line 18 def config @config || Trifle::Ruby.default end |
#perform ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/trifle/ruby/operations/timeseries/values.rb', line 26 def perform timeline.map do |at| { at => config.driver.get( key: [key, range, at.to_i].join(config.separator) ) } end end |