Class: Believe::Models::Player

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

Overview

Defined Under Namespace

Modules: MemberType

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:, character_id:, jersey_number:, position:, team_id:, years_with_team:, assists: nil, goals_scored: nil, is_captain: nil, member_type: nil) ⇒ Object

Full player model with ID.

Parameters:

  • id (String)

    Unique identifier for this team membership

  • character_id (String)

    ID of the character (references /characters/#id)

  • jersey_number (Integer)

    Jersey/shirt number

  • position (Symbol, ::Believe::Models::Position)

    Playing position on the field

  • team_id (String)

    ID of the team they belong to

  • years_with_team (Integer)

    Number of years with the current team

  • assists (Integer) (defaults to: nil)

    Total assists for the team

  • goals_scored (Integer) (defaults to: nil)

    Total goals scored for the team

  • is_captain (Boolean) (defaults to: nil)

    Whether this player is team captain

  • member_type (Symbol, ::Believe::Models::Player::MemberType) (defaults to: nil)

    Discriminator field indicating this is a player



# File 'lib/believe/models/player.rb', line 67

Instance Attribute Details

#assistsInteger?

Total assists for the team

Returns:

  • (Integer, nil)


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

optional :assists, Integer

#character_idString

ID of the character (references /characters/#id)

Returns:

  • (String)


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

required :character_id, String

#goals_scoredInteger?

Total goals scored for the team

Returns:

  • (Integer, nil)


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

optional :goals_scored, Integer

#idString

Unique identifier for this team membership

Returns:

  • (String)


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

required :id, String

#is_captainBoolean?

Whether this player is team captain

Returns:

  • (Boolean, nil)


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

optional :is_captain, ::Believe::Internal::Type::Boolean

#jersey_numberInteger

Jersey/shirt number

Returns:

  • (Integer)


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

required :jersey_number, Integer

#member_typeSymbol, ...

Discriminator field indicating this is a player

Returns:



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

optional :member_type, enum: -> { ::Believe::Player::MemberType }

#positionSymbol, ::Believe::Models::Position

Playing position on the field

Returns:



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

required :position, enum: -> { ::Believe::Position }

#team_idString

ID of the team they belong to

Returns:

  • (String)


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

required :team_id, String

#years_with_teamInteger

Number of years with the current team

Returns:

  • (Integer)


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

required :years_with_team, Integer