-
-
Save jrgriffiniii/8cf9ab64d4ecaff44a2f59284d23ba85 to your computer and use it in GitHub Desktop.
Module Refactor Failures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pry' | |
module MyModule | |
def foo | |
'foo' | |
end | |
def self.included(base) | |
def bar | |
binding.pry | |
'bar' | |
end | |
end | |
end | |
module MyOtherModule | |
include MyModule | |
def baz | |
'baz' | |
end | |
end | |
class MyClass | |
include MyOtherModule | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_modules.rb @ line 11 MyModule#bar: | |
9: def bar | |
10: binding.pry | |
=> 11: 'bar' | |
12: end | |
[1] pry(#<MyClass>)> ls | |
MyModule#methods: bar foo | |
MyOtherModule#methods: baz | |
locals: _ __ _dir_ _ex_ _file_ _in_ _out_ _pry_ | |
[2] pry(#<MyClass>)> self | |
=> #<MyClass:0x007fd4cd085aa8> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment