Class: Exa::Responses::PerPagePrices

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

Overview

Standard price per page for different content operations

Class Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Object



64
65
66
67
68
69
70
71
72
# File 'lib/exa/responses/cost.rb', line 64

def self.from_hash(hash)
  return nil unless hash
  sym = Helpers.symbolize_keys(hash)
  new(
    text: sym[:text]&.to_f,
    highlight: sym[:highlight]&.to_f,
    summary: sym[:summary]&.to_f
  )
end