aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/ruby/lib
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ruby/lib')
-rw-r--r--examples/ruby/lib/helloworld.rb18
-rw-r--r--examples/ruby/lib/helloworld_services.rb24
-rw-r--r--examples/ruby/lib/route_guide.rb37
-rw-r--r--examples/ruby/lib/route_guide_services.rb27
4 files changed, 106 insertions, 0 deletions
diff --git a/examples/ruby/lib/helloworld.rb b/examples/ruby/lib/helloworld.rb
new file mode 100644
index 0000000000..82bdd78e2a
--- /dev/null
+++ b/examples/ruby/lib/helloworld.rb
@@ -0,0 +1,18 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: helloworld.proto
+
+require 'google/protobuf'
+
+Google::Protobuf::DescriptorPool.generated_pool.build do
+ add_message "helloworld.HelloRequest" do
+ optional :name, :string, 1
+ end
+ add_message "helloworld.HelloReply" do
+ optional :message, :string, 1
+ end
+end
+
+module Helloworld
+ HelloRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("helloworld.HelloRequest").msgclass
+ HelloReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("helloworld.HelloReply").msgclass
+end
diff --git a/examples/ruby/lib/helloworld_services.rb b/examples/ruby/lib/helloworld_services.rb
new file mode 100644
index 0000000000..7da45ebc6b
--- /dev/null
+++ b/examples/ruby/lib/helloworld_services.rb
@@ -0,0 +1,24 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# Source: helloworld.proto for package 'helloworld'
+
+require 'grpc'
+require 'helloworld'
+
+module Helloworld
+ module Greeter
+
+ # TODO: add proto service documentation here
+ class Service
+
+ include GRPC::GenericService
+
+ self.marshal_class_method = :encode
+ self.unmarshal_class_method = :decode
+ self.service_name = 'helloworld.Greeter'
+
+ rpc :SayHello, HelloRequest, HelloReply
+ end
+
+ Stub = Service.rpc_stub_class
+ end
+end
diff --git a/examples/ruby/lib/route_guide.rb b/examples/ruby/lib/route_guide.rb
new file mode 100644
index 0000000000..98bac8395c
--- /dev/null
+++ b/examples/ruby/lib/route_guide.rb
@@ -0,0 +1,37 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: route_guide.proto
+
+require 'google/protobuf'
+
+Google::Protobuf::DescriptorPool.generated_pool.build do
+ add_message "examples.Point" do
+ optional :latitude, :int32, 1
+ optional :longitude, :int32, 2
+ end
+ add_message "examples.Rectangle" do
+ optional :lo, :message, 1, "examples.Point"
+ optional :hi, :message, 2, "examples.Point"
+ end
+ add_message "examples.Feature" do
+ optional :name, :string, 1
+ optional :location, :message, 2, "examples.Point"
+ end
+ add_message "examples.RouteNote" do
+ optional :location, :message, 1, "examples.Point"
+ optional :message, :string, 2
+ end
+ add_message "examples.RouteSummary" do
+ optional :point_count, :int32, 1
+ optional :feature_count, :int32, 2
+ optional :distance, :int32, 3
+ optional :elapsed_time, :int32, 4
+ end
+end
+
+module Examples
+ Point = Google::Protobuf::DescriptorPool.generated_pool.lookup("examples.Point").msgclass
+ Rectangle = Google::Protobuf::DescriptorPool.generated_pool.lookup("examples.Rectangle").msgclass
+ Feature = Google::Protobuf::DescriptorPool.generated_pool.lookup("examples.Feature").msgclass
+ RouteNote = Google::Protobuf::DescriptorPool.generated_pool.lookup("examples.RouteNote").msgclass
+ RouteSummary = Google::Protobuf::DescriptorPool.generated_pool.lookup("examples.RouteSummary").msgclass
+end
diff --git a/examples/ruby/lib/route_guide_services.rb b/examples/ruby/lib/route_guide_services.rb
new file mode 100644
index 0000000000..6e07653c42
--- /dev/null
+++ b/examples/ruby/lib/route_guide_services.rb
@@ -0,0 +1,27 @@
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# Source: route_guide.proto for package 'examples'
+
+require 'grpc'
+require 'route_guide'
+
+module Examples
+ module RouteGuide
+
+ # TODO: add proto service documentation here
+ class Service
+
+ include GRPC::GenericService
+
+ self.marshal_class_method = :encode
+ self.unmarshal_class_method = :decode
+ self.service_name = 'examples.RouteGuide'
+
+ rpc :GetFeature, Point, Feature
+ rpc :ListFeatures, Rectangle, stream(Feature)
+ rpc :RecordRoute, stream(Point), RouteSummary
+ rpc :RouteChat, stream(RouteNote), stream(RouteNote)
+ end
+
+ Stub = Service.rpc_stub_class
+ end
+end