Class: Einutricional::Person
- Inherits:
-
Object
- Object
- Einutricional::Person
- Defined in:
- lib/einutricional/person.rb
Overview
Clase base para almacenar los datos identificativos del paciente
Direct Known Subclasses
Instance Attribute Summary collapse
-
#age ⇒ Object
Returns the value of attribute age.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sex ⇒ Object
Returns the value of attribute sex.
-
#surname ⇒ Object
Returns the value of attribute surname.
Instance Method Summary collapse
-
#initialize(name, surname, sex, age) ⇒ Person
constructor
A new instance of Person.
-
#to_s ⇒ String
Imprime los datos del paciente.
Constructor Details
#initialize(name, surname, sex, age) ⇒ Person
Returns a new instance of Person.
6 7 8 9 10 11 |
# File 'lib/einutricional/person.rb', line 6 def initialize(name, surname, sex, age) @name = name @surname = surname @sex = sex @age = age end |
Instance Attribute Details
#age ⇒ Object
Returns the value of attribute age.
4 5 6 |
# File 'lib/einutricional/person.rb', line 4 def age @age end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/einutricional/person.rb', line 4 def name @name end |
#sex ⇒ Object
Returns the value of attribute sex.
4 5 6 |
# File 'lib/einutricional/person.rb', line 4 def sex @sex end |
#surname ⇒ Object
Returns the value of attribute surname.
4 5 6 |
# File 'lib/einutricional/person.rb', line 4 def surname @surname end |
Instance Method Details
#to_s ⇒ String
Imprime los datos del paciente
15 16 17 |
# File 'lib/einutricional/person.rb', line 15 def to_s "#{@surname}, #{@name}, #{@sex}, #{@age}" end |