Created
August 12, 2013 03:06
-
-
Save jedfoster/6208005 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby -wKU | |
module Bacon | |
class << self | |
attr_reader :crunchy | |
def config(crunchy) | |
@crunchy = crunchy | |
end | |
end | |
class Peppered | |
def crunchy? | |
Bacon.crunchy | |
end | |
end | |
end | |
class BLT | |
include Bacon | |
end | |
Bacon.config(true) | |
# BLT.config(false) # Doesn't work: "undefined method ‘config’ for BLT:Class" | |
blt = BLT::Peppered.new | |
puts blt.crunchy? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment