Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Created October 15, 2012 16:53
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 bil-bas/236202c3ea0fa8d80654 to your computer and use it in GitHub Desktop.
Save bil-bas/236202c3ea0fa8d80654 to your computer and use it in GitHub Desktop.
test
module Test
class << self
def list
@list ||= []
end
def add(id, item)
list << { :id => id, :item => item }
end
end
def each_bleh(&block)
Test.list.each &block
end
end
class Blah
include Test
def initialize
each_bleh { |item| puts item.to_yaml }
end
end
class Bleh
include Test
def initialize
each_bleh { |item| puts item.to_yaml }
end
end
Test.add :frog, "tree"
Blah.new
Bleh.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment