Class: Fog::AWS::ElasticBeanstalk::Environments

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/aws/models/beanstalk/environments.rb

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
13
# File 'lib/fog/aws/models/beanstalk/environments.rb', line 10

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

#get(environment_name) ⇒ Object

Gets an environment given a name.



17
18
19
20
21
22
23
# File 'lib/fog/aws/models/beanstalk/environments.rb', line 17

def get(environment_name)
  options = { 'EnvironmentNames' => [environment_name] }

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