Skip to content

Instantly share code, notes, and snippets.

@maasha

maasha/test.rb Secret

Created April 9, 2015 12:20
Show Gist options
  • Save maasha/b69be03a6ddbdd9d2e66 to your computer and use it in GitHub Desktop.
Save maasha/b69be03a6ddbdd9d2e66 to your computer and use it in GitHub Desktop.
Expecting 'hello world', but got ./test.rb:14:in `call_hello_world': undefined local variable or method `hello_world' for NameSpace::Bar:Module (NameError) from ./test.rb:19:in `<main>'
#!/usr/bin/env ruby
module NameSpace
module Foo
def hello_world
puts 'hello world'
end
end
module Bar
include Foo
def self.call_hello_world
hello_world
end
end
end
NameSpace::Bar.call_hello_world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment