Class: Character
- Inherits:
-
Object
- Object
- Character
- Defined in:
- lib/characters.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#appearance ⇒ Object
Returns the value of attribute appearance.
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#char_id ⇒ Object
Returns the value of attribute char_id.
-
#img ⇒ Object
Returns the value of attribute img.
-
#name ⇒ Object
Returns the value of attribute name.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#occupation ⇒ Object
Returns the value of attribute occupation.
-
#portrayed ⇒ Object
Returns the value of attribute portrayed.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(char_id, name, birthday, occupation, img, status, appearance, nickname, portrayed) ⇒ Character
constructor
A new instance of Character.
Constructor Details
#initialize(char_id, name, birthday, occupation, img, status, appearance, nickname, portrayed) ⇒ Character
Returns a new instance of Character.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/characters.rb', line 7 def initialize(char_id, name, birthday, occupation, img, status, appearance, nickname, portrayed) @char_id = char_id @name = name @birthday = birthday @occupation = occupation @img = img @status = status @appearance = appearance @nickname = nickname @portrayed = portrayed @@all << self end |
Instance Attribute Details
#appearance ⇒ Object
Returns the value of attribute appearance.
3 4 5 |
# File 'lib/characters.rb', line 3 def appearance @appearance end |
#birthday ⇒ Object
Returns the value of attribute birthday.
3 4 5 |
# File 'lib/characters.rb', line 3 def birthday @birthday end |
#char_id ⇒ Object
Returns the value of attribute char_id.
3 4 5 |
# File 'lib/characters.rb', line 3 def char_id @char_id end |
#img ⇒ Object
Returns the value of attribute img.
3 4 5 |
# File 'lib/characters.rb', line 3 def img @img end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/characters.rb', line 3 def name @name end |
#nickname ⇒ Object
Returns the value of attribute nickname.
3 4 5 |
# File 'lib/characters.rb', line 3 def nickname @nickname end |
#occupation ⇒ Object
Returns the value of attribute occupation.
3 4 5 |
# File 'lib/characters.rb', line 3 def occupation @occupation end |
#portrayed ⇒ Object
Returns the value of attribute portrayed.
3 4 5 |
# File 'lib/characters.rb', line 3 def portrayed @portrayed end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/characters.rb', line 3 def status @status end |
Class Method Details
.all ⇒ Object
20 21 22 |
# File 'lib/characters.rb', line 20 def self.all @@all end |
.find ⇒ Object
25 26 27 |
# File 'lib/characters.rb', line 25 def self.find self.all end |
.name ⇒ Object
29 30 31 |
# File 'lib/characters.rb', line 29 def self.name self.find end |