Class: MCollective::Aggregate::Result::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/mcollective/aggregate/result/base.rb

Direct Known Subclasses

CollectionResult, NumericResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result, aggregate_format, action) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
13
# File 'lib/mcollective/aggregate/result/base.rb', line 7

def initialize(result, aggregate_format, action)
  raise "No aggregate_format defined in ddl or aggregate function" unless aggregate_format

  @result = result
  @aggregate_format = aggregate_format
  @action = action
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



5
6
7
# File 'lib/mcollective/aggregate/result/base.rb', line 5

def action
  @action
end

#aggregate_formatObject

Returns the value of attribute aggregate_format.



5
6
7
# File 'lib/mcollective/aggregate/result/base.rb', line 5

def aggregate_format
  @aggregate_format
end

#resultObject

Returns the value of attribute result.



5
6
7
# File 'lib/mcollective/aggregate/result/base.rb', line 5

def result
  @result
end

Instance Method Details

#result_typeObject



19
20
21
# File 'lib/mcollective/aggregate/result/base.rb', line 19

def result_type
  @result[:type]
end

#to_sObject



15
16
17
# File 'lib/mcollective/aggregate/result/base.rb', line 15

def to_s
  raise "'to_s' method not implemented for result class '#{self.class}'"
end