Class: Einutricional::Person

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

Overview

Clase base para almacenar los datos identificativos del paciente

Direct Known Subclasses

Patient

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ageObject

Returns the value of attribute age.



4
5
6
# File 'lib/einutricional/person.rb', line 4

def age
  @age
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/einutricional/person.rb', line 4

def name
  @name
end

#sexObject

Returns the value of attribute sex.



4
5
6
# File 'lib/einutricional/person.rb', line 4

def sex
  @sex
end

#surnameObject

Returns the value of attribute surname.



4
5
6
# File 'lib/einutricional/person.rb', line 4

def surname
  @surname
end

Instance Method Details

#to_sString

Imprime los datos del paciente

Returns:

  • (String)

    los datos del paciente



15
16
17
# File 'lib/einutricional/person.rb', line 15

def to_s
  "#{@surname}, #{@name}, #{@sex}, #{@age}"
end