Module: Spice::Connection::Environments

Included in:
Spice, Spice::Connection
Defined in:
lib/spice/connection/environments.rb

Instance Method Summary (collapse)

Instance Method Details

- (Spice::Environment) environment(name)

Retrieve a single environment

Examples:

Retrieve the environment named "production"

Spice.environment("production")

Raises:



20
21
22
23
24
# File 'lib/spice/connection/environments.rb', line 20

def environment(name)
  attributes = connection.get("/environments/#{name}").body
  attributes['attrs'] = attributes.delete('attributes')
  Spice::Environment.new(attributes)
end

- (Array<Spice::Environment>) environments(options = {})

A collection of environments

Examples:

Retrieve all environments with names that begin with "prod"

Spice.environments(:q => "name:prod*")

See Also:



10
11
12
# File 'lib/spice/connection/environments.rb', line 10

def environments(options={})
  connection.search('environment', options)
end