Class: Datashake::ReviewScraper::V2::Profiles::Reviews

Inherits:
Object
  • Object
show all
Defined in:
lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb

Constant Summary collapse

PATH =
"api/v2/profiles/reviews"

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ Reviews

Returns a new instance of Reviews.



10
11
12
13
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 10

def initialize(version)
  @version = version
  @params = {}
end

Instance Method Details

#allow_response(allow_response) ⇒ Object



45
46
47
48
49
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 45

def allow_response(allow_response)
  @params[:allow_response] = allow_response

  self
end

#fetchObject



51
52
53
54
55
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 51

def fetch
  response = version.fetch(method: :get, path: PATH, params: params)

  Datashake::ReviewScraper::V2::ProfileInstance.new(response)
end

#from_date(from_date) ⇒ Object



21
22
23
24
25
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 21

def from_date(from_date)
  @params[:from_date] = from_date

  self
end

#job_id(job_id) ⇒ Object



15
16
17
18
19
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 15

def job_id(job_id)
  @params[:job_id] = job_id

  self
end

#language_code(language_code) ⇒ Object



27
28
29
30
31
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 27

def language_code(language_code)
  @params[:language_code] = language_code

  self
end

#page(page) ⇒ Object



33
34
35
36
37
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 33

def page(page)
  @params[:page] = page

  self
end

#per_page(per_page) ⇒ Object



39
40
41
42
43
# File 'lib/datashake-ruby-sdk/review_scraper/v2/profiles/reviews.rb', line 39

def per_page(per_page)
  @params[:per_page] = per_page

  self
end