PageRenderTime 56ms CodeModel.GetById 41ms app.highlight 12ms RepoModel.GetById 1ms 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
 1require 'director_abstract'
 2
 3class MyFoo < Director_abstract::Foo
 4  def ping
 5    "MyFoo::ping()"
 6  end
 7end
 8
 9
10a = MyFoo.new
11
12if a.ping != "MyFoo::ping()"
13  raise RuntimeError, a.ping
14end
15
16if a.pong != "Foo::pong();MyFoo::ping()"
17  raise RuntimeError, a.pong
18end
19
20
21class MyExample1 < Director_abstract::Example1
22  def color(r,g,b)
23    r
24  end
25end
26
27#m1 = MyExample1.new
28#
29#if m1.color(1,2,3) != 1
30#  raise RuntimeError, m1.color
31#end