Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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
Add Comment
Please, Sign In to add comment