Class: Scrapinghub::Items

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/scrapinghub/items.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Items

Returns a new instance of Items.



8
9
10
# File 'lib/scrapinghub/items.rb', line 8

def initialize(api_key)
  self.class.basic_auth(api_key, nil)
end

Instance Method Details

#get(id, opts = { format: 'json' }) ⇒ Object



12
13
14
# File 'lib/scrapinghub/items.rb', line 12

def get(id, opts = { format: 'json' })
  self.class.get("/#{id}", query: opts)
end

#stats(job, opts = {}) ⇒ Object



16
17
18
# File 'lib/scrapinghub/items.rb', line 16

def stats(job, opts = {})
  self.class.get("/#{job}/stats", query: opts)
end