Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created October 25, 2016 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7f60b90f93139eb723e2639c22b416fa to your computer and use it in GitHub Desktop.
Save anonymous/7f60b90f93139eb723e2639c22b416fa to your computer and use it in GitHub Desktop.
animal_index = {"rabbit" => "gray", "mouse" => "gray","dear" => "brown",
"bear" => "brown", "sheep" => "white", "flamingo" => "pink",
"beetle" => "red", "duck" => "white", "ant" => "black",
"donkey" => "brown", "dolphin" => "gray"}
class Animal
def initialize(name, color)
@name = name
@color = color
end
def self.listunderfive
if name.size < 5
puts "#{name} has less than 5 characters"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment