Class: Datashake::ReviewIndex::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/datashake-ruby-sdk/review_index/client.rb

Constant Summary collapse

BASE_URL =
"https://reviewindexapi.datashake.com"

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tokenObject (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

#connectionObject



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.options.timeout = timeout
    conn.options.open_timeout = open_timeout
    conn.adapter(adapter)
  end
end

#profilesObject



34
35
36
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 34

def profiles
  v1.profiles
end

#reviewsObject



38
39
40
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 38

def reviews
  v1.reviews
end

#update_statusObject



42
43
44
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 42

def update_status
  v1.update_status
end

#v1Object



30
31
32
# File 'lib/datashake-ruby-sdk/review_index/client.rb', line 30

def v1
  @v1 ||= V1.new(self)
end