Class: Rightscale::Slicehost::ZonesParser

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

Overview


Zones


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



559
560
561
# File 'lib/right_slicehost.rb', line 559

def reset
  @result = []
end

#tagend(name) ⇒ Object



550
551
552
553
554
555
556
557
558
# File 'lib/right_slicehost.rb', line 550

def tagend(name)
  case name
  when 'id'     then @item[:sls_id] = @text.to_i
  when 'origin' then @item[:origin] = @text
  when 'ttl'    then @item[:ttl]    = @text.to_i
  when 'active' then @item[:active] = @text == 'Y'
  when 'zone'   then @result       << @item
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



547
548
549
# File 'lib/right_slicehost.rb', line 547

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