Class: Believe::Models::Match

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/believe/models/match.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, away_team_id:, date:, home_team_id:, match_type:, attendance: nil, away_score: nil, episode_id: nil, home_score: nil, lesson_learned: nil, possession_percentage: nil, result: nil, ted_halftime_speech: nil, ticket_revenue_gbp: nil, turning_points: nil, weather_temp_celsius: nil) ⇒ Object

Full match model with ID.

Parameters:

  • id (String)

    Unique identifier

  • away_team_id (String)

    Away team ID

  • date (Time)

    Match date and time

  • home_team_id (String)

    Home team ID

  • match_type (Symbol, ::Believe::Models::MatchType)

    Type of match

  • attendance (Integer, nil) (defaults to: nil)

    Match attendance

  • away_score (Integer) (defaults to: nil)

    Away team score

  • episode_id (String, nil) (defaults to: nil)

    Episode ID where this match is featured

  • home_score (Integer) (defaults to: nil)

    Home team score

  • lesson_learned (String, nil) (defaults to: nil)

    The life lesson learned from this match

  • possession_percentage (Float, nil) (defaults to: nil)

    Home team possession percentage

  • result (Symbol, ::Believe::Models::MatchResult) (defaults to: nil)

    Match result from home team perspective

  • ted_halftime_speech (String, nil) (defaults to: nil)

    Ted’s inspirational halftime speech

  • ticket_revenue_gbp (String, nil) (defaults to: nil)

    Total ticket revenue in GBP

  • turning_points (Array<::Believe::Models::TurningPoint>) (defaults to: nil)

    Key moments that changed the match

  • weather_temp_celsius (Float, nil) (defaults to: nil)

    Temperature at kickoff in Celsius



# File 'lib/believe/models/match.rb', line 103

Instance Attribute Details

#attendanceInteger?

Match attendance

Returns:

  • (Integer, nil)


41
# File 'lib/believe/models/match.rb', line 41

optional :attendance, Integer, nil?: true

#away_scoreInteger?

Away team score

Returns:

  • (Integer, nil)


47
# File 'lib/believe/models/match.rb', line 47

optional :away_score, Integer

#away_team_idString

Away team ID

Returns:

  • (String)


17
# File 'lib/believe/models/match.rb', line 17

required :away_team_id, String

#dateTime

Match date and time

Returns:

  • (Time)


23
# File 'lib/believe/models/match.rb', line 23

required :date, Time

#episode_idString?

Episode ID where this match is featured

Returns:

  • (String, nil)


53
# File 'lib/believe/models/match.rb', line 53

optional :episode_id, String, nil?: true

#home_scoreInteger?

Home team score

Returns:

  • (Integer, nil)


59
# File 'lib/believe/models/match.rb', line 59

optional :home_score, Integer

#home_team_idString

Home team ID

Returns:

  • (String)


29
# File 'lib/believe/models/match.rb', line 29

required :home_team_id, String

#idString

Unique identifier

Returns:

  • (String)


11
# File 'lib/believe/models/match.rb', line 11

required :id, String

#lesson_learnedString?

The life lesson learned from this match

Returns:

  • (String, nil)


65
# File 'lib/believe/models/match.rb', line 65

optional :lesson_learned, String, nil?: true

#match_typeSymbol, ::Believe::Models::MatchType

Type of match

Returns:



35
# File 'lib/believe/models/match.rb', line 35

required :match_type, enum: -> { ::Believe::MatchType }

#possession_percentageFloat?

Home team possession percentage

Returns:

  • (Float, nil)


71
# File 'lib/believe/models/match.rb', line 71

optional :possession_percentage, Float, nil?: true

#resultSymbol, ...

Match result from home team perspective

Returns:



77
# File 'lib/believe/models/match.rb', line 77

optional :result, enum: -> { ::Believe::MatchResult }

#ted_halftime_speechString?

Ted’s inspirational halftime speech

Returns:

  • (String, nil)


83
# File 'lib/believe/models/match.rb', line 83

optional :ted_halftime_speech, String, nil?: true

#ticket_revenue_gbpString?

Total ticket revenue in GBP

Returns:

  • (String, nil)


89
# File 'lib/believe/models/match.rb', line 89

optional :ticket_revenue_gbp, String, nil?: true

#turning_pointsArray<::Believe::Models::TurningPoint>?

Key moments that changed the match

Returns:



95
# File 'lib/believe/models/match.rb', line 95

optional :turning_points, -> { ::Believe::Internal::Type::ArrayOf[::Believe::TurningPoint] }

#weather_temp_celsiusFloat?

Temperature at kickoff in Celsius

Returns:

  • (Float, nil)


101
# File 'lib/believe/models/match.rb', line 101

optional :weather_temp_celsius, Float, nil?: true