PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-29/SWIG/Examples/test-suite/ruby/director_abstract_runme.rb

#
Ruby | 31 lines | 18 code | 8 blank | 5 comment | 4 complexity | 4281ccead94ed4d92a1c553225895e6d MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. require 'director_abstract'
  2. class MyFoo < Director_abstract::Foo
  3. def ping
  4. "MyFoo::ping()"
  5. end
  6. end
  7. a = MyFoo.new
  8. if a.ping != "MyFoo::ping()"
  9. raise RuntimeError, a.ping
  10. end
  11. if a.pong != "Foo::pong();MyFoo::ping()"
  12. raise RuntimeError, a.pong
  13. end
  14. class MyExample1 < Director_abstract::Example1
  15. def color(r,g,b)
  16. r
  17. end
  18. end
  19. #m1 = MyExample1.new
  20. #
  21. #if m1.color(1,2,3) != 1
  22. # raise RuntimeError, m1.color
  23. #end