Skip to content

Instantly share code, notes, and snippets.

@krzkrzkrz
Created July 11, 2014 16:29
Show Gist options
  • Save krzkrzkrz/d12d6630190cae9988f4 to your computer and use it in GitHub Desktop.
Save krzkrzkrz/d12d6630190cae9988f4 to your computer and use it in GitHub Desktop.
class Foo
attr_accessor :current_session
def initialize(current_session)
@current_session = current_session
end
def foobarbaz
# Baz.send(:include, Bar)
Baz.include(Bar)
end
end
class Baz
end
module Bar
def foobar
@current_session
# 'foobar'
end
end
puts Foo.new('current_session').foobarbaz.new.foobar # 'foobar'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment