Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person
- attr_accessor :name, :height, :hair_color, :fatness
- def initialize(name, height, hair, fatness)
- self.name = name.capitalize
- self.height = height.to_f
- self.hair_color = hair.capitalize
- self.fatness = fatness
- end
- def fit?
- return true if (height > 5 && fatness == false && hair_color == "blonde")
- return false
- end
- def make_thin
- self.fatness = false
- end
- def dye_hair(colour)
- self.hair_color = colour
- end
- def describe
- "#{name} is #{height} tall, has #{hair_color} hair and #{fatness ? "is" : "is not"} fat."
- end
- end
- class Baby < Person
- attr_accessor :smellyness
- def initialize(name, smellyness, fatness)
- self.name = name.capitalize
- self.height = 1
- self.hair_color = "None"
- self.fatness = fatness
- self.smellyness = smellyness
- end
- def fit?
- return "It's a fucking baby mate"
- end
- end
Add Comment
Please, Sign In to add comment