Class: Memoir::Downsample

Inherits:
Object
  • Object
show all
Defined in:
lib/memoir/downsample.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time_period, aggregator, fill_policy = nil) ⇒ Downsample

Returns a new instance of Downsample.



4
5
6
7
8
# File 'lib/memoir/downsample.rb', line 4

def initialize(time_period, aggregator, fill_policy = nil)
  @time_period = time_period
  @aggregator = aggregator
  @fill_policy = fill_policy
end

Instance Attribute Details

#aggregatorObject

Returns the value of attribute aggregator.



2
3
4
# File 'lib/memoir/downsample.rb', line 2

def aggregator
  @aggregator
end

#fill_policyObject

Returns the value of attribute fill_policy.



2
3
4
# File 'lib/memoir/downsample.rb', line 2

def fill_policy
  @fill_policy
end

#time_periodObject

Returns the value of attribute time_period.



2
3
4
# File 'lib/memoir/downsample.rb', line 2

def time_period
  @time_period
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
# File 'lib/memoir/downsample.rb', line 10

def to_s
  downsample = "#{time_period}-#{aggregator}"
  downsample = "#{downsample}-#{fill_policy}" if fill_policy

  downsample
end