Grouper::Rest::Client - Minimal REST client for interacting with the Grouper WS API.

Usage

Grouper::Rest::Client::Resource.new url, :user => user, :password => pass do |grouper|
  # Find all stems matching identifier.
  stems = grouper.stems('some:approximate:stem')

  # Find stem by name.
  stem = grouper.stem('some:stem')

  # UUID of stem.
  stem['uuid']

  # Find all groups matching identifier.
  groups = grouper.groups('some:approximate:group')

  # Find group by name.
  group = grouper.group('some:group')

  # UUID of group.
  group['uuid']

  # Get members of group.
  members = group.members

  # Find all subjects matching identifier.
  subjects = grouper.subjects('foo')

  # Find subject. 
  subject = grouper.subject('blair')

  # Subject's name and id.
  subject['name']
  subject['id']

  # In what groups is this subject a member?
  my_groups = subject.groups()

  # In what groups within the specified stem is this subject a member?
  my_filtered_groups = subject.groups('some:stem')

  # Was the last WS call successful?
  grouper.ok?

  # Was there an error on the last WS call?
  grouper.error?
end