Skip to content

Instantly share code, notes, and snippets.

@ender672
Created April 24, 2009 17:39
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 ender672/101233 to your computer and use it in GitHub Desktop.
Save ender672/101233 to your computer and use it in GitHub Desktop.
========== test.rb ==========
module MixinModule
def say_hello
puts "Hello #{CLASS_CONSTANT}"
end
end
class SomeClass
CLASS_CONSTANT = 'FOO!'
include MixinModule
end
SomeClass.new.say_hello
=============================
$ ruby test.rb
test.rb:3:in `say_hello': uninitialized constant MixinModule::CLASS_CONSTANT (NameError)
from test.rb:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment