Class: Rubiderella::Person
- Inherits:
-
Object
- Object
- Rubiderella::Person
- Defined in:
- lib/rubiderella/person.rb,
lib/rubiderella/person/name.rb,
lib/rubiderella/person/birthday.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#age ⇒ Object
readonly
Returns the value of attribute age.
-
#birthday ⇒ Object
readonly
Returns the value of attribute birthday.
-
#blood ⇒ Object
readonly
Returns the value of attribute blood.
-
#bust ⇒ Object
readonly
Returns the value of attribute bust.
-
#cv ⇒ Object
readonly
Returns the value of attribute cv.
-
#favorite ⇒ Object
readonly
Returns the value of attribute favorite.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#handed ⇒ Object
readonly
Returns the value of attribute handed.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#hip ⇒ Object
readonly
Returns the value of attribute hip.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sign ⇒ Object
readonly
Returns the value of attribute sign.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#waist ⇒ Object
readonly
Returns the value of attribute waist.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Class Method Summary collapse
- .all ⇒ Object
- .config ⇒ Object
- .find_by_key(key) ⇒ Object
- .names ⇒ Object
- .valid?(person_name) ⇒ Boolean
Instance Method Summary collapse
-
#initialize(args) ⇒ Person
constructor
A new instance of Person.
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
#age ⇒ Object (readonly)
Returns the value of attribute age.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def age @age end |
#birthday ⇒ Object (readonly)
Returns the value of attribute birthday.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def birthday @birthday end |
#blood ⇒ Object (readonly)
Returns the value of attribute blood.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def blood @blood end |
#bust ⇒ Object (readonly)
Returns the value of attribute bust.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def bust @bust end |
#cv ⇒ Object (readonly)
Returns the value of attribute cv.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def cv @cv end |
#favorite ⇒ Object (readonly)
Returns the value of attribute favorite.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def favorite @favorite end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def from @from end |
#handed ⇒ Object (readonly)
Returns the value of attribute handed.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def handed @handed end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def height @height end |
#hip ⇒ Object (readonly)
Returns the value of attribute hip.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def hip @hip end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def name @name end |
#sign ⇒ Object (readonly)
Returns the value of attribute sign.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def sign @sign end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def type @type end |
#waist ⇒ Object (readonly)
Returns the value of attribute waist.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def waist @waist end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
5 6 7 |
# File 'lib/rubiderella/person.rb', line 5 def weight @weight end |
Class Method Details
.all ⇒ Object
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 |
.config ⇒ Object
30 31 32 |
# File 'lib/rubiderella/person.rb', line 30 def config raise NotImplementedError end |
.find_by_key(key) ⇒ Object
49 50 51 |
# File 'lib/rubiderella/person.rb', line 49 def find_by_key(key) raise NotImplementedError end |
.names ⇒ Object
34 35 36 |
# File 'lib/rubiderella/person.rb', line 34 def names config.keys end |
.valid?(person_name) ⇒ Boolean
38 39 40 |
# File 'lib/rubiderella/person.rb', line 38 def valid?(person_name) names.include?(person_name) end |