-
-
Save bil-bas/236202c3ea0fa8d80654 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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