Class: InOrOut::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/in_or_out/models/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(player_name, team_name, **options) ⇒ Player

Returns a new instance of Player.



6
7
8
9
# File 'lib/in_or_out/models/player.rb', line 6

def initialize(player_name, team_name,  **options)
  @name, @team = player_name, team_name
  @number, @position, @status = options[:number], options[:position], options[:status]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/in_or_out/models/player.rb', line 4

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/in_or_out/models/player.rb', line 4

def number
  @number
end

#positionObject (readonly)

Returns the value of attribute position.



4
5
6
# File 'lib/in_or_out/models/player.rb', line 4

def position
  @position
end

#teamObject (readonly)

Returns the value of attribute team.



4
5
6
# File 'lib/in_or_out/models/player.rb', line 4

def team
  @team
end

Instance Method Details

#statusObject



21
22
23
24
# File 'lib/in_or_out/models/player.rb', line 21

def status
  evaluate_status unless @status
  @status
end