foo.rb
Ruby
code posted
created at 02 Oct 19:04
Edit
|
Back
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 |
irb(main):001:0> class Foo irb(main):002:1> def foo irb(main):003:2> "foo" irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> module X irb(main):007:1> class Foo irb(main):008:2> def foo irb(main):009:3> "bar" irb(main):010:3> end irb(main):011:2> end irb(main):012:1> end => nil irb(main):013:0> f = Foo.new^C irb(main):013:0> Foo.new.foo => "foo" irb(main):014:0> X::Foo.new.foo => "bar" irb(main):015:0> include X => Object irb(main):016:0> Foo => Foo irb(main):017:0> Foo.new.foo => "foo" |
533 Bytes in 4 ms with coderay