Module: Spice::Connection::Roles

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

Instance Method Summary (collapse)

Instance Method Details

- (Spice::Role) role(name)

Retrieve a single role

Examples:

Retrieve the role "app_server"

Spice.role("app_server")

Raises:



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

def role(name)
  attributes = connection.get("/roles/#{name}").body
  Spice::Role.new(attributes)
end

- (Array<Spice::Role>) roles(options = {})

A collection of roles

Examples:

Retrieve all roles that start with "app_"

Spice.roles(:q => "name:app_*")

See Also:



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

def roles(options={})
  connection.search('role', options)
end