Class: Pebblebed::CheckpointClient

Inherits:
GenericClient show all
Defined in:
lib/pebblebed/clients/checkpoint_client.rb

Instance Method Summary collapse

Methods inherited from GenericClient

#initialize, #perform, #service_params, #service_url

Methods inherited from AbstractClient

#delete, #get, #perform, #post, #put

Constructor Details

This class inherits a constructor from Pebblebed::GenericClient

Instance Method Details

#find_identities(ids) ⇒ Object

Given a list of identity IDs it returns each identity or an empty hash for identities that doesnt exists. If pebbles are configured with memcached, results will be cached. Params: ids a list of identities



12
13
14
15
16
17
18
19
20
21
# File 'lib/pebblebed/clients/checkpoint_client.rb', line 12

def find_identities(ids)

  result = {}
  request = get("/identities/#{ids.join(',')},")
  ids.each_with_index do |id, i|
    identity = request.identities[i].identity.unwrap
    result[id] = identity
  end
  return DeepStruct.wrap(ids.collect {|id| result[id]})
end

#god?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/pebblebed/clients/checkpoint_client.rb', line 23

def god?
  me.god if me
end

#meObject



3
4
5
6
7
# File 'lib/pebblebed/clients/checkpoint_client.rb', line 3

def me
  return @identity if @identity_checked
  @identity_checked = true
  @identity = get("/identities/me")[:identity]
end