-
-
Save pixeltrix/217074 to your computer and use it in GitHub Desktop.
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
# This works | |
require 'rubygems' | |
require 'activesupport' | |
class Base | |
def self.cry | |
"#{self.name}.cry called!" | |
end | |
end | |
module Behaviour | |
def blame | |
puts self.class.parent.const_get(:Child).cry | |
end | |
end | |
module Parent | |
class Child < Base | |
end | |
class Sibling < Base | |
include Behaviour | |
end | |
end | |
sibling = Parent::Sibling.new | |
sibling.blame # NameError here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment