Class: Gigya::IdentityStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/gigya/identity_storage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id, client_secret) ⇒ IdentityStorage

Returns a new instance of IdentityStorage.



7
8
9
10
11
# File 'lib/gigya/identity_storage.rb', line 7

def initialize(client_id, client_secret)
  @base_url      = Gigya.build_url(Gigya::URLS[:ids], Gigya::URIS[:search])
  @client_id     = client_id
  @client_secret = client_secret
end

Instance Attribute Details

#client_idObject (readonly)

Returns the value of attribute client_id.



5
6
7
# File 'lib/gigya/identity_storage.rb', line 5

def client_id
  @client_id
end

#client_secretObject (readonly)

Returns the value of attribute client_secret.



5
6
7
# File 'lib/gigya/identity_storage.rb', line 5

def client_secret
  @client_secret
end

Instance Method Details

#search(query) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/gigya/identity_storage.rb', line 13

def search(query)
  params = build_params(@base_url, query)

  response = Gigya.connection.post do |request|
    request.url @base_url
    request.body = params
  end

  Hashie::Mash.new(JSON.parse(response.body))
end