-
-
Save ernesto-jimenez/2d328c7f0e97fa1a697c to your computer and use it in GitHub Desktop.
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
require 'rubygems' | |
require 'ruby2ruby' | |
module Foo | |
def foo | |
puts "foo" | |
end | |
end | |
puts "primera definición" | |
puts Ruby2Ruby.translate(Foo) | |
module FooBar | |
def bar | |
puts "bar" | |
end | |
end | |
Foo.send(:include, FooBar) | |
puts "\nextendido" | |
puts Ruby2Ruby.translate(Foo) | |
# RESULTADO: | |
# primera definición | |
# module Foo | |
# def foo | |
# puts("foo") | |
# end | |
# end | |
# | |
# extendido | |
# module Foo | |
# def foo | |
# puts("foo") | |
# end | |
# | |
# def bar | |
# puts("bar") | |
# end | |
# end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment