Class: RightAws::AcwInterface::GetMetricStatisticsParser

Inherits:
RightAWSParser show all
Defined in:
lib/acw/right_acw_interface.rb

Overview


PARSERS: MetricStatistics

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



214
215
216
# File 'lib/acw/right_acw_interface.rb', line 214

def reset
  @result = { :datapoints => [] }
end

#tagend(name) ⇒ Object



200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/acw/right_acw_interface.rb', line 200

def tagend(name)
  case name
  when 'Timestamp'  then @item[:timestamp]   = @text
  when 'Unit'       then @item[:unit]        = @text
  when 'CustomUnit' then @item[:custom_unit] = @text
  when 'Samples'    then @item[:samples]     = @text.to_f
  when 'Average'    then @item[:average]     = @text.to_f
  when 'Minimum'    then @item[:minimum]     = @text.to_f
  when 'Maximum'    then @item[:maximum]     = @text.to_f
  when 'Sum'        then @item[:sum]         = @text.to_f
  when 'member'     then @result[:datapoints] << @item
  when 'Label'      then @result[:label]     = @text
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



197
198
199
# File 'lib/acw/right_acw_interface.rb', line 197

def tagstart(name, attributes)
  @item = {} if name == 'member'
end