Class: Exa::Responses::Webset

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/exa/responses/webset_response.rb

Class Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/exa/responses/webset_response.rb', line 21

def self.from_hash(hash)
  sym = Helpers.symbolize_keys(hash)
  new(
    id: sym[:id],
    object: sym[:object],
    status: sym[:status],
    external_id: sym[:externalId],
    title: sym[:title],
    searches: Array(sym[:searches]),
    imports: Array(sym[:imports]),
    enrichments: Array(sym[:enrichments]),
    monitors: Array(sym[:monitors]),
    streams: Array(sym[:streams]),
    metadata: Helpers.stringify_string_hash(sym[:metadata]),
    created_at: sym[:createdAt],
    updated_at: sym[:updatedAt],
    raw: sym
  )
end