Sha256: 1ad7df3ac650c68022bd054d1cdc416dc3cec4ae5c59e95ac5a69f70b3b5f7a1

Contents?: true

Size: 781 Bytes

Versions: 22

Compression:

Stored size: 781 Bytes

Contents

require 'fog/core/collection'
require 'fog/aws/models/beanstalk/environment'

module Fog
  module AWS
    class ElasticBeanstalk
      class Environments < Fog::Collection
        model Fog::AWS::ElasticBeanstalk::Environment

        def all(options={})
          data = service.describe_environments(options).body['DescribeEnvironmentsResult']['Environments']
          load(data) # data is an array of attribute hashes
        end

        # Gets an environment given a name.
        #
        def get(environment_name)
          options = { 'EnvironmentNames' => [environment_name] }

          if data = service.describe_environments(options).body['DescribeEnvironmentsResult']['Environments'].first
            new(data)
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
ns-fog-1.22.2 lib/fog/aws/models/beanstalk/environments.rb
fog-1.22.1 lib/fog/aws/models/beanstalk/environments.rb