Class: Riveter::Resources::Extractions
- Inherits:
-
Object
- Object
- Riveter::Resources::Extractions
- Defined in:
- lib/riveter/resources.rb
Overview
Reusable site scrape/extract recipes and their runs.
Instance Method Summary collapse
-
#create(**params) ⇒ Object
Create an extraction and start its agent discovery.
-
#get(extraction_id) ⇒ Object
The extraction's status and definition.
-
#initialize(client) ⇒ Extractions
constructor
A new instance of Extractions.
-
#run(extraction_id, **params) ⇒ Object
Execute a ready extraction.
Constructor Details
#initialize(client) ⇒ Extractions
Returns a new instance of Extractions.
119 120 121 |
# File 'lib/riveter/resources.rb', line 119 def initialize(client) @client = client end |
Instance Method Details
#create(**params) ⇒ Object
Create an extraction and start its agent discovery. (operationId: createExtraction)
124 125 126 |
# File 'lib/riveter/resources.rb', line 124 def create(**params) Extraction.new(@client.request(:post, "/extractions", body: params)) end |
#get(extraction_id) ⇒ Object
The extraction's status and definition. (operationId: getExtraction)
129 130 131 |
# File 'lib/riveter/resources.rb', line 129 def get(extraction_id) Extraction.new(@client.request(:get, "/extractions/#{extraction_id}")) end |