Class: Exa::Services::Websets::CancelEnrichment
- Inherits:
-
Object
- Object
- Exa::Services::Websets::CancelEnrichment
- Defined in:
- lib/exa/services/websets/cancel_enrichment.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, webset_id:, id:) ⇒ CancelEnrichment
constructor
A new instance of CancelEnrichment.
Constructor Details
#initialize(connection, webset_id:, id:) ⇒ CancelEnrichment
Returns a new instance of CancelEnrichment.
7 8 9 10 11 |
# File 'lib/exa/services/websets/cancel_enrichment.rb', line 7 def initialize(connection, webset_id:, id:) @connection = connection @webset_id = webset_id @id = id end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/exa/services/websets/cancel_enrichment.rb', line 13 def call response = @connection.post("/websets/v0/websets/#{@webset_id}/enrichments/#{@id}/cancel", {}) body = response.body Resources::WebsetEnrichment.new( id: body["id"], object: body["object"], status: body["status"], webset_id: body["websetId"], title: body["title"], description: body["description"], format: body["format"], options: body["options"], instructions: body["instructions"], metadata: body["metadata"], created_at: body["createdAt"], updated_at: body["updatedAt"] ) end |