Class: Sportradar::Api::Odds::Outcome
- Defined in:
- lib/sportradar/api/odds/outcome.rb
Instance Attribute Summary collapse
-
#external_outcome_id ⇒ Object
Returns the value of attribute external_outcome_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#odds_american ⇒ Object
Returns the value of attribute odds_american.
-
#odds_decimal ⇒ Object
Returns the value of attribute odds_decimal.
-
#odds_fraction ⇒ Object
Returns the value of attribute odds_fraction.
-
#open_odds_american ⇒ Object
Returns the value of attribute open_odds_american.
-
#open_odds_decimal ⇒ Object
Returns the value of attribute open_odds_decimal.
-
#open_odds_fraction ⇒ Object
Returns the value of attribute open_odds_fraction.
-
#open_total ⇒ Object
Returns the value of attribute open_total.
-
#removed ⇒ Object
Returns the value of attribute removed.
-
#response ⇒ Object
Returns the value of attribute response.
-
#total ⇒ Object
Returns the value of attribute total.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data, **opts) ⇒ Outcome
constructor
A new instance of Outcome.
- #update(data, **opts) ⇒ Object
Methods inherited from Data
#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data
Constructor Details
#initialize(data, **opts) ⇒ Outcome
Returns a new instance of Outcome.
9 10 11 12 13 14 15 16 |
# File 'lib/sportradar/api/odds/outcome.rb', line 9 def initialize(data, **opts) @response = data @api = opts[:api] @id = data['id'] update(data, **opts) end |
Instance Attribute Details
#external_outcome_id ⇒ Object
Returns the value of attribute external_outcome_id.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def external_outcome_id @external_outcome_id end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/sportradar/api/odds/outcome.rb', line 5 def id @id end |
#odds_american ⇒ Object
Returns the value of attribute odds_american.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def odds_american @odds_american end |
#odds_decimal ⇒ Object
Returns the value of attribute odds_decimal.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def odds_decimal @odds_decimal end |
#odds_fraction ⇒ Object
Returns the value of attribute odds_fraction.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def odds_fraction @odds_fraction end |
#open_odds_american ⇒ Object
Returns the value of attribute open_odds_american.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def open_odds_american @open_odds_american end |
#open_odds_decimal ⇒ Object
Returns the value of attribute open_odds_decimal.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def open_odds_decimal @open_odds_decimal end |
#open_odds_fraction ⇒ Object
Returns the value of attribute open_odds_fraction.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def open_odds_fraction @open_odds_fraction end |
#open_total ⇒ Object
Returns the value of attribute open_total.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def open_total @open_total end |
#removed ⇒ Object
Returns the value of attribute removed.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def removed @removed end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/sportradar/api/odds/outcome.rb', line 5 def response @response end |
#total ⇒ Object
Returns the value of attribute total.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def total @total end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/sportradar/api/odds/outcome.rb', line 6 def type @type end |
Instance Method Details
#update(data, **opts) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sportradar/api/odds/outcome.rb', line 18 def update(data, **opts) @type = data['type'] if data['type'] @odds_decimal = data['odds_decimal'] if data['odds_decimal'] @odds_american = data['odds_american'] if data['odds_american'] @odds_fraction = data['odds_fraction'] if data['odds_fraction'] @open_odds_decimal = data['open_odds_decimal'] if data['open_odds_decimal'] @open_odds_american = data['open_odds_american'] if data['open_odds_american'] @open_odds_fraction = data['open_odds_fraction'] if data['open_odds_fraction'] @total = data['total'] if data['total'] @open_total = data['open_total'] if data['open_total'] @external_outcome_id = data['external_outcome_id'] if data['external_outcome_id'] @removed = data['removed'] if data['removed'] end |