Module: PlantWatchdog::Model::AggregationRuleOwner

Included in:
Device, Plant
Defined in:
lib/plantwatchdog/model.rb

Instance Method Summary collapse

Instance Method Details

#aggrulesObject



181
182
183
# File 'lib/plantwatchdog/model.rb', line 181

def aggrules
  self.aggregationrule ? self.aggregationrule.description : {};
end

#aggrules=(dict) ⇒ Object

set a dictionary defining the aggregation rules dict-keys are the names of the resulting columns dict-values defines the aggregation, the first entry is the name of the agg function, following (optional) are parameters for the function



175
176
177
178
179
# File 'lib/plantwatchdog/model.rb', line 175

def aggrules=(dict)
  return if aggregationrule and aggregationrule.description == dict
  self.aggregationrule = Metadata.new
  self.aggregationrule.description = dict
end