Class: RightAws::Ec2::QEc2DescribeVolumesParser

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

Overview

:nodoc:

Constant Summary

Constants inherited from RightAWSParser

RightAWSParser::DEFAULT_XML_LIBRARY

Instance Attribute Summary

Attributes inherited from RightAWSParser

#result, #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



1697
1698
1699
# File 'lib/ec2/right_ec2.rb', line 1697

def reset
  @result = []
end

#tagend(name) ⇒ Object



1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
# File 'lib/ec2/right_ec2.rb', line 1673

def tagend(name)
  case name 
    when 'volumeId'
      case @xmlpath
      when 'DescribeVolumesResponse/volumeSet/item' then @volume[:aws_id] = @text
      end
    when 'status'
      case @xmlpath
      when 'DescribeVolumesResponse/volumeSet/item' then @volume[:aws_status] = @text
      when 'DescribeVolumesResponse/volumeSet/item/attachmentSet/item' then @volume[:aws_attachment_status] = @text
      end
    when 'size'             then @volume[:aws_size]        = @text.to_i
    when 'createTime'       then @volume[:aws_created_at]  = Time.parse(@text)
    when 'instanceId'       then @volume[:aws_instance_id] = @text
    when 'device'           then @volume[:aws_device]      = @text
    when 'attachTime'       then @volume[:aws_attached_at] = Time.parse(@text)
    when 'snapshotId'       then @volume[:snapshot_id]     = @text.blank? ? nil : @text
    when 'availabilityZone' then @volume[:zone]            = @text
    when 'item' 
      case @xmlpath
      when 'DescribeVolumesResponse/volumeSet' then @result << @volume
      end
  end
end

#tagstart(name, attributes) ⇒ Object



1665
1666
1667
1668
1669
1670
1671
1672
# File 'lib/ec2/right_ec2.rb', line 1665

def tagstart(name, attributes)
  case name
  when 'item'
    case @xmlpath
      when 'DescribeVolumesResponse/volumeSet' then @volume = {}
    end
  end
end