Class: Rightscale::Slicehost::FlavorsParser

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

Overview


Flavors


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



482
483
484
# File 'lib/right_slicehost.rb', line 482

def reset
  @result = []
end

#tagend(name) ⇒ Object



473
474
475
476
477
478
479
480
481
# File 'lib/right_slicehost.rb', line 473

def tagend(name)
  case name
  when 'id'     then @item[:sls_id] = @text.to_i
  when 'name'   then @item[:name]   = @text
  when 'price'  then @item[:price]  = @text.to_i
  when 'ram'    then @item[:ram]    = @text.to_i
  when 'flavor' then @result        << @item
  end
end

#tagstart(name, attributes) ⇒ Object

:nodoc:



470
471
472
# File 'lib/right_slicehost.rb', line 470

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