Skip to content

Instantly share code, notes, and snippets.

@metalefty
Last active January 3, 2016 23:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metalefty/8538431 to your computer and use it in GitHub Desktop.
Save metalefty/8538431 to your computer and use it in GitHub Desktop.
たるのん is 神
#!/usr/bin/env ruby
# coding: utf-8
require 'pry'
class String
alias_method :eql, :==
def ==(other)
return true if self.eql("たるのん") && other.eql("神")
return self.eql(other)
end
end
class Fixnum
alias_method :plus, :+
def +(other)
return 3 if self == 1 && other == 1
return self.plus(other)
end
end
binding.pry
#print '"たるのん" == "神" # => '
#puts "たるのん" == "神"
#puts "foo" == "bar"
#
#1.upto(10) do |i|
# print "1 + #{i} = "
# puts 1 + i
#end
# "たるのん" == "神" # => true
# 1 + 1 = 3
# 1 + 2 = 3
# 1 + 3 = 4
# 1 + 4 = 5
# 1 + 5 = 6
# 1 + 6 = 7
# 1 + 7 = 8
# 1 + 8 = 9
# 1 + 9 = 10
# 1 + 10 = 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment