Class: Exa::Responses::AnswerCitation

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

Class Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/exa/responses/answer_response.rb', line 15

def self.from_hash(hash)
  sym = Helpers.symbolize_keys(hash)
  new(
    id: sym[:id],
    url: sym[:url],
    title: sym[:title],
    author: sym[:author],
    published_date: sym[:publishedDate],
    text: sym[:text],
    image: sym[:image],
    favicon: sym[:favicon]
  )
end