Class: Rubiderella::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/rubiderella/person.rb,
lib/rubiderella/person/name.rb,
lib/rubiderella/person/birthday.rb

Direct Known Subclasses

Assistant, Idol, Trainer

Defined Under Namespace

Classes: Birthday, Name

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Person

Returns a new instance of Person.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rubiderella/person.rb', line 11

def initialize(args)
  @name = Name.new(args[:name])
  @type = args[:type]
  @age = args[:age]
  @birthday = Birthday.new(args[:birthday])
  @sign = args[:sign]
  @blood = args[:blood]
  @height = args[:height]
  @weight = args[:weight]
  @bust = args[:bust]
  @waist = args[:waist]
  @hip = args[:hip]
  @handed = args[:handed]
  @from = args[:from]
  @favorite = args[:favorite]
  @cv = args[:cv]
end

Instance Attribute Details

#ageObject (readonly)

Returns the value of attribute age.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def age
  @age
end

#birthdayObject (readonly)

Returns the value of attribute birthday.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def birthday
  @birthday
end

#bloodObject (readonly)

Returns the value of attribute blood.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def blood
  @blood
end

#bustObject (readonly)

Returns the value of attribute bust.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def bust
  @bust
end

#cvObject (readonly)

Returns the value of attribute cv.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def cv
  @cv
end

#favoriteObject (readonly)

Returns the value of attribute favorite.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def favorite
  @favorite
end

#fromObject (readonly)

Returns the value of attribute from.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def from
  @from
end

#handedObject (readonly)

Returns the value of attribute handed.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def handed
  @handed
end

#heightObject (readonly)

Returns the value of attribute height.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def height
  @height
end

#hipObject (readonly)

Returns the value of attribute hip.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def hip
  @hip
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def name
  @name
end

#signObject (readonly)

Returns the value of attribute sign.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def sign
  @sign
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def type
  @type
end

#waistObject (readonly)

Returns the value of attribute waist.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def waist
  @waist
end

#weightObject (readonly)

Returns the value of attribute weight.



5
6
7
# File 'lib/rubiderella/person.rb', line 5

def weight
  @weight
end

Class Method Details

.allObject



42
43
44
45
46
47
# File 'lib/rubiderella/person.rb', line 42

def all
  @all = config.map do |key, value|
    value[:key] = key
    new(**value)
  end
end

.configObject

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/rubiderella/person.rb', line 30

def config
  raise NotImplementedError
end

.find_by_key(key) ⇒ Object

Raises:

  • (NotImplementedError)


49
50
51
# File 'lib/rubiderella/person.rb', line 49

def find_by_key(key)
  raise NotImplementedError
end

.namesObject



34
35
36
# File 'lib/rubiderella/person.rb', line 34

def names
  config.keys
end

.valid?(person_name) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/rubiderella/person.rb', line 38

def valid?(person_name)
  names.include?(person_name)
end