Skip to content

Instantly share code, notes, and snippets.

@sevperez
Created March 22, 2018 15:16
Show Gist options
  • Save sevperez/75762cdad3f156ffe485e263782d7510 to your computer and use it in GitHub Desktop.
Save sevperez/75762cdad3f156ffe485e263782d7510 to your computer and use it in GitHub Desktop.
class Lion
attr_reader :name, :age, :weight, :height, :bravery
def initialize(name, age, weight, height, bravery)
@name = name
@age = age
@weight = weight
@height = height
@bravery = bravery
end
end
simba = Lion.new(“Simba”, 10, 37, 60, 99)
scar = Lion.new(“Scar”, 42, 190, 128, 72)
puts simba > scar # => NoMethodError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment