Skip to content

Instantly share code, notes, and snippets.

@nb
Last active December 15, 2015 15:09
Show Gist options
  • Save nb/c426bc61995d5bd5f260 to your computer and use it in GitHub Desktop.
Save nb/c426bc61995d5bd5f260 to your computer and use it in GitHub Desktop.
def twice(name, &blk)
yield 1, 2
yield [1, 2]
blk.call(1, 2)
end
a, b = 1, 2
10.times do
puts 'toshko'
end
class Fixnum
def ordinalize
self.to_s + 'th'
end
end
class Toshko
has_many :order_items
belongs_to :client
def foo
end
10.times { |current| self.define_method "m#{current}") {} }
def self.foo
end
end
def Toshko.foo
end
t1 = Toshko.new
t2 = Toshko.new
twice 'foo' do |a|
end
lambda do
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment