Class: Datashake::ReviewScraper::V2::Profiles::Job

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

Constant Summary collapse

PATH =
"api/v2/profiles/jobs"

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ Job

Returns a new instance of Job.



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

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

Instance Method Details

#fetchObject



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

def fetch
  path = "#{PATH}/#{params[:job_id]}"
  response = version.fetch(method: :get, path: path)

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

#job_id(job_id) ⇒ Object



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

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

  self
end