Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat foo.rb
- module Stock
- STOCK_LIST = 'I am groot'
- end
- module Stock
- class Holder
- def initialize
- puts STOCK_LIST
- end
- end
- end
- class Stock::Holder2
- def initialize
- puts STOCK_LIST
- end
- end
- Stock::Holder.new
- Stock::Holder2.new
- $ ruby foo.rb
- I am groot
- foo.rb:15:in `initialize': uninitialized constant Stock::Holder2::STOCK_LIST (NameError)
- from foo.rb:20:in `new'
- from foo.rb:20:in `<main>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement