Class: Individuo
Direct Known Subclasses
Instance Attribute Summary collapse
-
#persona ⇒ Object
readonly
Returns the value of attribute persona.
-
#peso ⇒ Object
readonly
Returns the value of attribute peso.
-
#talla ⇒ Object
readonly
Returns the value of attribute talla.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(persona, peso, talla) ⇒ Individuo
constructor
A new instance of Individuo.
- #to_s ⇒ Object
Constructor Details
#initialize(persona, peso, talla) ⇒ Individuo
Returns a new instance of Individuo.
4 5 6 7 8 |
# File 'lib/gema/persona.rb', line 4 def initialize(persona,peso,talla) @persona=persona @peso=peso @talla=talla end |
Instance Attribute Details
#persona ⇒ Object (readonly)
Returns the value of attribute persona.
3 4 5 |
# File 'lib/gema/persona.rb', line 3 def persona @persona end |
#peso ⇒ Object (readonly)
Returns the value of attribute peso.
3 4 5 |
# File 'lib/gema/persona.rb', line 3 def peso @peso end |
#talla ⇒ Object (readonly)
Returns the value of attribute talla.
3 4 5 |
# File 'lib/gema/persona.rb', line 3 def talla @talla end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 15 |
# File 'lib/gema/persona.rb', line 12 def <=>(other) return nil unless other.instance_of?Individuo @peso <=> other.peso end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/gema/persona.rb', line 9 def to_s "#{@persona} #{@peso} #{@talla}" end |