Class: Character

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#appearanceObject

Returns the value of attribute appearance.



3
4
5
# File 'lib/characters.rb', line 3

def appearance
  @appearance
end

#birthdayObject

Returns the value of attribute birthday.



3
4
5
# File 'lib/characters.rb', line 3

def birthday
  @birthday
end

#char_idObject

Returns the value of attribute char_id.



3
4
5
# File 'lib/characters.rb', line 3

def char_id
  @char_id
end

#imgObject

Returns the value of attribute img.



3
4
5
# File 'lib/characters.rb', line 3

def img
  @img
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/characters.rb', line 3

def name
  @name
end

#nicknameObject

Returns the value of attribute nickname.



3
4
5
# File 'lib/characters.rb', line 3

def nickname
  @nickname
end

#occupationObject

Returns the value of attribute occupation.



3
4
5
# File 'lib/characters.rb', line 3

def occupation
  @occupation
end

#portrayedObject

Returns the value of attribute portrayed.



3
4
5
# File 'lib/characters.rb', line 3

def portrayed
  @portrayed
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/characters.rb', line 3

def status
  @status
end

Class Method Details

.allObject



20
21
22
# File 'lib/characters.rb', line 20

def self.all
  @@all
end

.findObject



25
26
27
# File 'lib/characters.rb', line 25

def self.find
  self.all
end

.nameObject



29
30
31
# File 'lib/characters.rb', line 29

def self.name
  self.find
end