Class: Rightscale::Slicehost::RecordsParser

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

Overview


Records


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



585
586
587
# File 'lib/right_slicehost.rb', line 585

def reset
  @result = []
end

#tagend(name) ⇒ Object



572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/right_slicehost.rb', line 572

def tagend(name)
  case name
  when 'id'          then @item[:sls_id]      = @text.to_i
  when 'record-type' then @item[:record_type] = @text
  when 'zone-id'     then @item[:zone_id]     = @text.to_i
  when 'name'        then @item[:name]        = @text
  when 'data'        then @item[:data]        = @text
  when 'ttl'         then @item[:ttl]         = @text.to_i
  when 'active'      then @item[:active]      = @text == 'Y'
  when 'aux'         then @item[:aux]         = @text
  when 'record'      then @result            << @item
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



569
570
571
# File 'lib/right_slicehost.rb', line 569

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