Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/bucs_roster/player.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#bio ⇒ Object
Returns the value of attribute bio.
-
#college ⇒ Object
Returns the value of attribute college.
-
#experience ⇒ Object
Returns the value of attribute experience.
-
#height ⇒ Object
Returns the value of attribute height.
-
#jersey_number ⇒ Object
Returns the value of attribute jersey_number.
-
#name ⇒ Object
Returns the value of attribute name.
-
#player_URL ⇒ Object
Returns the value of attribute player_URL.
-
#position ⇒ Object
Returns the value of attribute position.
-
#weight ⇒ Object
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, player_URL) ⇒ Player
constructor
A new instance of Player.
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
#age ⇒ Object
Returns the value of attribute age.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def age @age end |
#bio ⇒ Object
Returns the value of attribute bio.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def bio @bio end |
#college ⇒ Object
Returns the value of attribute college.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def college @college end |
#experience ⇒ Object
Returns the value of attribute experience.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def experience @experience end |
#height ⇒ Object
Returns the value of attribute height.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def height @height end |
#jersey_number ⇒ Object
Returns the value of attribute jersey_number.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def jersey_number @jersey_number end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def name @name end |
#player_URL ⇒ Object
Returns the value of attribute player_URL.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def player_URL @player_URL end |
#position ⇒ Object
Returns the value of attribute position.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def position @position end |
#weight ⇒ Object
Returns the value of attribute weight.
2 3 4 |
# File 'lib/bucs_roster/player.rb', line 2 def weight @weight end |
Class Method Details
.all ⇒ Object
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 |