Class: Gigya::IdentityStorage
- Inherits:
-
Object
- Object
- Gigya::IdentityStorage
- Defined in:
- lib/gigya/identity_storage.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
Instance Method Summary collapse
-
#initialize(client_id, client_secret) ⇒ IdentityStorage
constructor
A new instance of IdentityStorage.
- #search(query) ⇒ Object
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_id ⇒ Object (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_secret ⇒ Object (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 |