Skip to content

Instantly share code, notes, and snippets.

@jedfoster
Created August 12, 2013 03:06
Show Gist options
  • Save jedfoster/6208005 to your computer and use it in GitHub Desktop.
Save jedfoster/6208005 to your computer and use it in GitHub Desktop.
#!/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