~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/ruby/enum/runme.rb

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2002-03-29 01:56:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020329015607-c0wt03xu8oy9ioj7
Tags: upstream-1.3.11
ImportĀ upstreamĀ versionĀ 1.3.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# file: runme.rb
 
2
 
 
3
require 'example'
 
4
 
 
5
# ----- Object creation -----
 
6
 
 
7
# Print out the value of some enums
 
8
print "*** color ***\n"
 
9
print "    RED    = #{Example::RED}\n"
 
10
print "    BLUE   = #{Example::BLUE}\n"
 
11
print "    GREEN  = #{Example::GREEN}\n"
 
12
 
 
13
print "\n*** Foo::speed ***\n"
 
14
print "    Foo::IMPULSE   = #{Example::Foo::IMPULSE}\n"
 
15
print "    Foo::WARP      = #{Example::Foo::WARP}\n"
 
16
print "    Foo::LUDICROUS = #{Example::Foo::LUDICROUS}\n"
 
17
 
 
18
print "\nTesting use of enums with functions\n\n"
 
19
 
 
20
Example::enum_test(Example::RED, Example::Foo::IMPULSE)
 
21
Example::enum_test(Example::BLUE,  Example::Foo::WARP)
 
22
Example::enum_test(Example::GREEN, Example::Foo::LUDICROUS)
 
23
Example::enum_test(1234, 5678)
 
24
 
 
25
print "\nTesting use of enum with class method\n"
 
26
f = Example::Foo.new()
 
27
 
 
28
f.enum_test(Example::Foo::IMPULSE)
 
29
f.enum_test(Example::Foo::WARP)
 
30
f.enum_test(Example::Foo::LUDICROUS)