Module: Spice::Connection::Environments

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

Instance Method Summary collapse

Instance Method Details

#environment(name) ⇒ Spice::Environment

Retrieve a single environment

Examples:

Retrieve the environment named “production”

Spice.environment("production")

Parameters:

  • name (String)

    The environment name

Returns:

Raises:


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

def environment(name)
  attributes = get("/environments/#{name}")
  Spice::Environment.get_or_new(attributes)
end

#environments(options = Mash.new) ⇒ Array<Spice::Environment>

A collection of environments

Examples:

Retrieve all environments with names that begin with “prod”

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

Parameters:

  • options (Hash) (defaults to: Mash.new)

    An options hash that is passed to Search#search

Returns:

See Also:


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

def environments(options=Mash.new)
  search('environment', options)
end