Class: Awsum::Ec2::RegisterImageParser

Inherits:
Parser show all
Defined in:
lib/awsum/ec2/parsers/register_image_parser.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Parser

#parse, #xmldecl

Constructor Details

#initialize(ec2) ⇒ RegisterImageParser

Returns a new instance of RegisterImageParser.



4
5
6
7
8
# File 'lib/awsum/ec2/parsers/register_image_parser.rb', line 4

def initialize(ec2)
  @ec2 = ec2
  @image = nil
  @text = nil
end

Instance Method Details

#resultObject



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

def result
  @image
end

#tag_end(tag) ⇒ Object



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

def tag_end(tag)
  case tag
    when 'imageId'
      @image = @text
      @text = nil
  end
end

#tag_start(tag, attributes) ⇒ Object



10
11
12
13
14
15
# File 'lib/awsum/ec2/parsers/register_image_parser.rb', line 10

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

#text(text) ⇒ Object



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

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