Create a gist now

Instantly share code, notes, and snippets.

@jayrobin /debug_on_included.rb Secret
Last active Oct 11, 2016

What would you like to do?
module FormatHelper
def self.included(base)
puts base # prints the scope where it's included
puts caller # prints call stack, which will point to the file that's including it
def phone_number
# return phone number
# Result:
# Object
# ["../mock/blueprints.rb:1:in `include'", ...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment