Class: Rightscale::Slicehost::BackupsParser

Inherits:
RightSlicehostParser show all
Defined in:
lib/right_slicehost.rb

Overview


Backups


Constant Summary

Constants inherited from RightSlicehostParser

RightSlicehostParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightSlicehostParser

#result, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightSlicehostParser

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

Constructor Details

This class inherits a constructor from Rightscale::RightSlicehostParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rightscale::RightSlicehostParser

Instance Method Details

#resetObject



504
505
506
# File 'lib/right_slicehost.rb', line 504

def reset
  @result = []
end

#tagend(name) ⇒ Object



495
496
497
498
499
500
501
502
503
# File 'lib/right_slicehost.rb', line 495

def tagend(name)
  case name
  when 'id'       then @item[:sls_id]       = @text
  when 'name'     then @item[:name]         = @text
  when 'slice_id' then @item[:slice_sls_id] = @text.to_i
  when 'date'     then @item[:date]         = Time.parse(@text)
  when 'backup'   then @result             << @item
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



492
493
494
# File 'lib/right_slicehost.rb', line 492

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