Class: Awsum::Ec2::PurchaseReservedInstancesOfferingParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/awsum/ec2/parsers/purchase_reserved_instances_offering_parser.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Parser

#parse, #xmldecl

Constructor Details

#initialize(ec2) ⇒ PurchaseReservedInstancesOfferingParser

Returns a new instance of PurchaseReservedInstancesOfferingParser.



6
7
8
9
10
11
# File 'lib/awsum/ec2/parsers/purchase_reserved_instances_offering_parser.rb', line 6

def initialize(ec2)
  @ec2 = ec2
  @ids = []
  @text = nil
  @stack = []
end

Instance Method Details

#resultObject



29
30
31
# File 'lib/awsum/ec2/parsers/purchase_reserved_instances_offering_parser.rb', line 29

def result
  @ids
end

#tag_end(tag) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/awsum/ec2/parsers/purchase_reserved_instances_offering_parser.rb', line 21

def tag_end(tag)
  case tag
    when 'reservedInstancesId'
      text = @text.strip
      @ids << (text == '' ? nil : text)
  end
end

#tag_start(tag, attributes) ⇒ Object



13
14
15
# File 'lib/awsum/ec2/parsers/purchase_reserved_instances_offering_parser.rb', line 13

def tag_start(tag, attributes)
  @text = ''
end

#text(text) ⇒ Object



17
18
19
# File 'lib/awsum/ec2/parsers/purchase_reserved_instances_offering_parser.rb', line 17

def text(text)
  @text << text unless @text.nil?
end