Class: Exa::Services::Websets::RetrieveEnrichment

Inherits:
Object
  • Object
show all
Defined in:
lib/exa/services/websets/retrieve_enrichment.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, webset_id:, id:) ⇒ RetrieveEnrichment

Returns a new instance of RetrieveEnrichment.



7
8
9
10
11
# File 'lib/exa/services/websets/retrieve_enrichment.rb', line 7

def initialize(connection, webset_id:, id:)
  @connection = connection
  @webset_id = webset_id
  @id = id
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/exa/services/websets/retrieve_enrichment.rb', line 13

def call
  response = @connection.get("/websets/v0/websets/#{@webset_id}/enrichments/#{@id}")
  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