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



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

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.



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

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

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