thrift/test/rb/TestHandler.rb
Mark Slee 89f5716421 Ruby default values patch
Summary: Submitted by Dan Sully, reviewed by Kevin Clark

Reviewed By: dreiss

Test Plan: New ruby generated code with default vals, and new test scripts


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665418 13f79535-47bb-0310-9956-ffa450edef68
2008-01-10 00:53:08 +00:00

74 lines
948 B
Ruby

#!/usr/bin/env ruby
$:.push('gen-rb')
$:.push('../../lib/rb/lib')
require 'ThriftTest'
class TestHandler
def testVoid
end
def testString(thing)
return thing
end
def testByte(thing)
return thing
end
def testI32(thing)
return thing
end
def testI64(thing)
return thing
end
def testDouble(thing)
return thing
end
def testStruct(thing)
return thing
end
def testMap(thing)
return thing
end
def testSet(thing)
return thing
end
def testList(thing)
return thing
end
def testNest(thing)
return thing
end
def testInsanity(thing)
num, uid = thing.userMap.find { true }
return {uid => {num => thing}}
end
def testMapMap(thing)
return {thing => {thing => thing}}
end
def testEnum(thing)
return thing
end
def testTypedef(thing)
return thing
end
def testException(thing)
raise Thrift::Test::Xception, 'error'
end
end