Class: RandomPerson::Person
- Inherits:
-
Object
- Object
- RandomPerson::Person
- Defined in:
- lib/randomperson/person.rb
Overview
Your general person
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#dob ⇒ Object
Returns the value of attribute dob.
-
#first ⇒ Object
Returns the value of attribute first.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#last ⇒ Object
Returns the value of attribute last.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#suffix ⇒ Object
Returns the value of attribute suffix.
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ Person
constructor
A new instance of Person.
Constructor Details
#initialize(h = {}) ⇒ Person
Returns a new instance of Person.
16 17 18 19 20 21 22 23 24 |
# File 'lib/randomperson/person.rb', line 16 def initialize( h={} ) @gender = h[:gender] || nil @age = h[:age] || nil @dob = h[:dob] || nil @first = h[:first] || nil @last = h[:last] || nil @prefix = h[:prefix] || nil @suffix = h[:suffix] || nil end |
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def age @age end |
#dob ⇒ Object
Returns the value of attribute dob.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def dob @dob end |
#first ⇒ Object
Returns the value of attribute first.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def first @first end |
#gender ⇒ Object
Returns the value of attribute gender.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def gender @gender end |
#last ⇒ Object
Returns the value of attribute last.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def last @last end |
#prefix ⇒ Object
Returns the value of attribute prefix.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def prefix @prefix end |
#suffix ⇒ Object
Returns the value of attribute suffix.
6 7 8 |
# File 'lib/randomperson/person.rb', line 6 def suffix @suffix end |