Skip to content

Instantly share code, notes, and snippets.

@coaxial

coaxial/bar.rb Secret

Created April 3, 2023 09:26
Show Gist options
  • Save coaxial/31b62e852855c6baa2bca2acfc6e0e05 to your computer and use it in GitHub Desktop.
Save coaxial/31b62e852855c6baa2bca2acfc6e0e05 to your computer and use it in GitHub Desktop.
# lib/tools/bar.rb
module MyApp
module Tools
module Bar
def bar_method(item)
# ...
Foo.foo_method # => Undefined method `foo_method` for MyApp::Tools::Foo.Module
end
end
end
end
# lib/tools/foo.rb
module MyApp
module Tools
module Foo
def foo_method
# ...
end
end
end
end
# lib/tools/helpers.rb
module MyApp
module Tools
module Helpers
def my_helper(args)
args.reject { |item| Bar.bar_method item }
end
end
end
end
# lib/tools/tools.rb
require './lib/tools/foo.rb'
require './lib/tools/bar.rb'
require './lib/tools/helpers.rb'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment