Class: RightAws::Ec2::QEc2DescribeVolumesParser

Inherits:
RightAWSParser show all
Defined in:
lib/ec2/right_ec2_ebs.rb

Overview

:nodoc:

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#full_tag_name, #result, #tag, #xml_lib, #xmlpath

Instance Method Summary collapse

Methods inherited from RightAWSParser

#initialize, #method_missing, #parse, #tag_end, #tag_start, #tagtext, #text, xml_lib, xml_lib=

Constructor Details

This class inherits a constructor from RightAws::RightAWSParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightAws::RightAWSParser

Instance Method Details

#resetObject



451
452
453
# File 'lib/ec2/right_ec2_ebs.rb', line 451

def reset
  @result = []
end

#tagend(name) ⇒ Object



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/ec2/right_ec2_ebs.rb', line 427

def tagend(name)
  case name
  when 'size'             then @item[:aws_size]        = @text.to_i
  when 'createTime'       then @item[:aws_created_at]  = @text
  when 'instanceId'       then @item[:aws_instance_id] = @text
  when 'device'           then @item[:aws_device]      = @text
  when 'attachTime'       then @item[:aws_attached_at] = @text
  when 'snapshotId'       then @item[:snapshot_id]     = @text.right_blank? ? nil : @text
  when 'availabilityZone' then @item[:zone]            = @text
  when 'deleteOnTermination' then @item[:delete_on_termination] = (@text == 'true')
  when 'volumeType'       then @item[:volume_type]     = @text
  when 'iops'             then @item[:iops]            = @text
  else
    case full_tag_name
    when %r{/volumeSet/item/volumeId$}   then @item[:aws_id]                = @text
    when %r{/volumeSet/item/status$}     then @item[:aws_status]            = @text
    when %r{/attachmentSet/item/status$} then @item[:aws_attachment_status] = @text
    when %r{/tagSet/item/key$}           then @aws_tag[:key]                = @text
    when %r{/tagSet/item/value$}         then @aws_tag[:value]              = @text
    when %r{/tagSet/item$}               then @item[:tags][@aws_tag[:key]]  = @aws_tag[:value]
    when %r{/volumeSet/item$}            then @result << @item
    end
  end
end

#tagstart(name, attributes) ⇒ Object



421
422
423
424
425
426
# File 'lib/ec2/right_ec2_ebs.rb', line 421

def tagstart(name, attributes)
  case full_tag_name
  when %r{volumeSet/item$} then @item    = { :tags => {} }
  when %r{/tagSet/item$}   then @aws_tag = {}
  end
end