Class: Exa::Services::Websets::Retrieve

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

Instance Method Summary collapse

Constructor Details

#initialize(connection, id:, **params) ⇒ Retrieve

Returns a new instance of Retrieve.



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

def initialize(connection, id:, **params)
  @connection = connection
  @id = id
  @params = normalize_params(params)
end

Instance Method Details

#callObject



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

def call
  response = @connection.get("/websets/v0/websets/#{@id}", @params)
  body = response.body

  Resources::Webset.new(
    id: body["id"],
    object: body["object"],
    status: body["status"],
    external_id: body["externalId"],
    title: body["title"],
    searches: body["searches"],
    imports: body["imports"],
    enrichments: body["enrichments"],
    monitors: body["monitors"],
    excludes: body["excludes"],
    metadata: body["metadata"],
    created_at: body["createdAt"],
    updated_at: body["updatedAt"],
    items: body["items"]
  )
end