Skip to content

Instantly share code, notes, and snippets.

@pasberth
Created November 22, 2011 03:14
Show Gist options
  • Select an option

  • Save pasberth/1384794 to your computer and use it in GitHub Desktop.

Select an option

Save pasberth/1384794 to your computer and use it in GitHub Desktop.
Array#=== をかっこ良く
class Array
def === other
zip(other.to_ary).all? { |mine, theirs| mine === theirs }
end
end
puts case [:lover, 'mana', 18]
when [Symbol, String, Integer] then 'love!'
else 'hello!'
end
# => love!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment