rb: Create constants for field ids in generated structs [THRIFT-165]
Author: Bryan Duxbury
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705330 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/gen-rb/NonblockingService.rb b/lib/rb/spec/gen-rb/NonblockingService.rb
index 5893f74..ee5fae1 100644
--- a/lib/rb/spec/gen-rb/NonblockingService.rb
+++ b/lib/rb/spec/gen-rb/NonblockingService.rb
@@ -115,22 +115,27 @@
class Greeting_args
include Thrift::Struct
+ ENGLISH = 1
+
Thrift::Struct.field_accessor self, :english
FIELDS = {
- 1 => {:type => Thrift::Types::BOOL, :name => 'english'}
+ ENGLISH => {:type => Thrift::Types::BOOL, :name => 'english'}
}
end
class Greeting_result
include Thrift::Struct
+ SUCCESS = 0
+
Thrift::Struct.field_accessor self, :success
FIELDS = {
- 0 => {:type => Thrift::Types::STRUCT, :name => 'success', :class => Hello}
+ SUCCESS => {:type => Thrift::Types::STRUCT, :name => 'success', :class => Hello}
}
end
class Block_args
include Thrift::Struct
+
FIELDS = {
}
@@ -138,22 +143,27 @@
class Block_result
include Thrift::Struct
+ SUCCESS = 0
+
Thrift::Struct.field_accessor self, :success
FIELDS = {
- 0 => {:type => Thrift::Types::BOOL, :name => 'success'}
+ SUCCESS => {:type => Thrift::Types::BOOL, :name => 'success'}
}
end
class Unblock_args
include Thrift::Struct
+ N = 1
+
Thrift::Struct.field_accessor self, :n
FIELDS = {
- 1 => {:type => Thrift::Types::I32, :name => 'n'}
+ N => {:type => Thrift::Types::I32, :name => 'n'}
}
end
class Unblock_result
include Thrift::Struct
+
FIELDS = {
}
@@ -161,6 +171,7 @@
class Shutdown_args
include Thrift::Struct
+
FIELDS = {
}
@@ -168,6 +179,7 @@
class Shutdown_result
include Thrift::Struct
+
FIELDS = {
}
@@ -175,14 +187,17 @@
class Sleep_args
include Thrift::Struct
+ SECONDS = 1
+
Thrift::Struct.field_accessor self, :seconds
FIELDS = {
- 1 => {:type => Thrift::Types::DOUBLE, :name => 'seconds'}
+ SECONDS => {:type => Thrift::Types::DOUBLE, :name => 'seconds'}
}
end
class Sleep_result
include Thrift::Struct
+
FIELDS = {
}