Class: Datashake::ReviewIndex::Client
- Inherits:
-
Object
- Object
- Datashake::ReviewIndex::Client
- Defined in:
- lib/datashake-ruby-sdk/review_index/client.rb
Constant Summary collapse
- BASE_URL =
"https://reviewindexapi.datashake.com"
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(token:, adapter: Faraday.default_adapter, timeout: 30, open_timeout: 30) ⇒ Client
constructor
A new instance of Client.
- #profiles ⇒ Object
- #reviews ⇒ Object
- #update_status ⇒ Object
- #v1 ⇒ Object
Constructor Details
#initialize(token:, adapter: Faraday.default_adapter, timeout: 30, open_timeout: 30) ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 17 |
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 12 def initialize(token:, adapter: Faraday.default_adapter, timeout: 30, open_timeout: 30) @token = token @adapter = adapter @timeout = timeout @open_timeout = open_timeout end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
10 11 12 |
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 10 def token @token end |
Instance Method Details
#connection ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 19 def connection @connection ||= Faraday.new do |conn| conn.url_prefix = BASE_URL conn.request(:json) conn.response(:json, content_type: "application/json") conn..timeout = timeout conn..open_timeout = open_timeout conn.adapter(adapter) end end |
#profiles ⇒ Object
34 35 36 |
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 34 def profiles v1.profiles end |
#reviews ⇒ Object
38 39 40 |
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 38 def reviews v1.reviews end |
#update_status ⇒ Object
42 43 44 |
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 42 def update_status v1.update_status end |