Sha256: d09c8518da869de16017dc50bca4ed4e6b1f3e4f70208b9e45b8be4a53407c46

Contents?: true

Size: 765 Bytes

Versions: 2

Compression:

Stored size: 765 Bytes

Contents

module Fog
  module AWS
    class EC2

      def volumes
        Fog::AWS::EC2::Volumes.new(:connection => self)
      end

      class Volumes < Fog::Collection

        def all(volume_id = [])
          data = connection.describe_volumes(volume_id)
          volumes = []
          data['volumeSet'].each do |volume|
            volumes << Fog::AWS::EC2::Volume.new({
              :connection => connection
            }.merge!(volume))
          end
          volumes
        end

        def create(attributes = {})
          volume = new(attributes)
          volume.save
          volume
        end

        def new(attributes = {})
          Fog::AWS::EC2::Volume.new(attributes.merge!(:connection => connection))
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-0.0.4 lib/fog/aws/models/ec2/volumes.rb
fog-0.0.3 lib/fog/aws/models/ec2/volumes.rb