fork(2) download
  1. # your code goes here
  2.  
  3. module A
  4. def ok
  5. @a || false
  6. end
  7.  
  8. class B
  9. def initialize
  10. if ok?
  11. puts "yes"
  12. else
  13. puts "no"
  14. end
  15. end
  16. end
  17. end
  18.  
  19. t = A::B.new
Runtime error #stdin #stdout #stderr 0.01s 7456KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:10:in `initialize': undefined method `ok?' for #<A::B:0x90c3808> (NoMethodError)
	from prog.rb:19:in `new'
	from prog.rb:19:in `<main>'