Class: Jumbotron::Deserializers::Clients::Espn::CompetitionOdds::Price

Inherits:
Object
  • Object
show all
Defined in:
app/deserializers/jumbotron/deserializers/clients/espn/competition_odds/price.rb

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Class Method Details

.call(payload) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/deserializers/jumbotron/deserializers/clients/espn/competition_odds/price.rb', line 18

def self.call(payload)
  Support.ensure_hash!(payload, label: "price")

  Result.build!(
    value: Support.payload.fetch(payload, "value"),
    display_value: Support.payload.fetch(payload, "displayValue"),
    alternate_display_value: Support.payload.fetch(payload, "alternateDisplayValue"),
    decimal: Support.payload.fetch(payload, "decimal"),
    fraction: Support.payload.fetch(payload, "fraction"),
    american: Support.payload.fetch(payload, "american")
  )
end