Class: Player

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, player_URL) ⇒ Player

Returns a new instance of Player.



5
6
7
8
9
# File 'lib/bucs_roster/player.rb', line 5

def initialize(name, player_URL)
  @name = name
  @player_URL = player_URL
  @@all << self
end

Instance Attribute Details

#ageObject

Returns the value of attribute age.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def age
  @age
end

#bioObject

Returns the value of attribute bio.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def bio
  @bio
end

#collegeObject

Returns the value of attribute college.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def college
  @college
end

#experienceObject

Returns the value of attribute experience.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def experience
  @experience
end

#heightObject

Returns the value of attribute height.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def height
  @height
end

#jersey_numberObject

Returns the value of attribute jersey_number.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def jersey_number
  @jersey_number
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def name
  @name
end

#player_URLObject

Returns the value of attribute player_URL.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def player_URL
  @player_URL
end

#positionObject

Returns the value of attribute position.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def position
  @position
end

#weightObject

Returns the value of attribute weight.



2
3
4
# File 'lib/bucs_roster/player.rb', line 2

def weight
  @weight
end

Class Method Details

.allObject



11
12
13
# File 'lib/bucs_roster/player.rb', line 11

def self.all
  @@all
end

.show_player_info(index) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bucs_roster/player.rb', line 15

def self.show_player_info(index)
  player = self.all[index]
  puts " ---- Tampa Bay Buccaneers Player Profile ----"
  puts "            #{player.name.upcase} | #{player.jersey_number} | #{player.position}"
  puts ""
  puts "Height: #{player.height}"
  puts "Weight: #{player.weight}"
  puts "Age: #{player.age}"
  puts "College: #{player.college}"
  puts "Experience: #{player.experience}"
  puts "Biography: \n#{player.bio}\n\n"
end