public
Description: ruby2ruby code for my rubyconf08 talk
Homepage:
Clone URL: git://github.com/mchung/ruby2ruby_rubyconf08.git
ruby2ruby_rubyconf08 / 7_include_ordering.rb
100644 35 lines (27 sloc) 0.447 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module SkillFly
   def power
      puts "Up, up, and away"
   end
end
 
module SkillSmash
   def power
      puts "Hulk, smash"
   end
end
 
class Superman
   include SkillSmash
   include SkillFly
end
 
class Hulk
   include SkillFly
   include SkillSmash
end
 
if $0 == __FILE__
  require 'rubygems'
  require 'ruby2ruby'
 
  puts Ruby2Ruby.translate(Superman)
  Superman.new.power
 
  puts "=="
 
  puts Ruby2Ruby.translate(Hulk)
  Hulk.new.power
end