Class: Scrapinghub::Items
- Inherits:
-
Object
- Object
- Scrapinghub::Items
- Includes:
- HTTParty
- Defined in:
- lib/scrapinghub/items.rb
Instance Method Summary collapse
- #get(id, opts = { format: 'json' }) ⇒ Object
-
#initialize(api_key) ⇒ Items
constructor
A new instance of Items.
- #stats(job, opts = {}) ⇒ Object
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 |