protobuf 2.4.4 → 2.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,6 +51,7 @@ module Protobuf
51
51
  # Private Instance Methods
52
52
  #
53
53
  def normalize(value)
54
+ value = value.to_proto if value.respond_to?(:to_proto)
54
55
  raise TypeError unless @field.acceptable?(value)
55
56
 
56
57
  if @field.is_a?(::Protobuf::Field::EnumField)
@@ -44,6 +44,8 @@ module Protobuf
44
44
  @values.delete(field.name)
45
45
  when val.is_a?(field.type) then
46
46
  @values[field.name] = val
47
+ when val.respond_to?(:to_proto) then
48
+ @values[field.name] = val.to_proto
47
49
  when val.respond_to?(:to_hash) then
48
50
  @values[field.name] = field.type.new(val.to_hash)
49
51
  else
@@ -11,8 +11,8 @@ module Protobuf
11
11
  RpcMethod = Struct.new("RpcMethod", :method, :request_type, :response_type)
12
12
 
13
13
  class Service
14
- include Protobuf::Rpc::ServiceFilters
15
- include Protobuf::Logger::LogMethods
14
+ include ::Protobuf::Rpc::ServiceFilters
15
+ include ::Protobuf::Logger::LogMethods
16
16
 
17
17
 
18
18
  attr_reader :response, :rpc
@@ -98,7 +98,6 @@ module Protobuf
98
98
  rpcs.key?(name)
99
99
  end
100
100
 
101
-
102
101
  ##
103
102
  # Instance Methods
104
103
  #
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.4.4'
2
+ VERSION = '2.4.5'
3
3
  PROTOC_VERSION = '2.4.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -498,7 +498,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
498
498
  version: '0'
499
499
  segments:
500
500
  - 0
501
- hash: 1973744142414396176
501
+ hash: 1832425573722106451
502
502
  required_rubygems_version: !ruby/object:Gem::Requirement
503
503
  none: false
504
504
  requirements:
@@ -507,7 +507,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
507
507
  version: '0'
508
508
  segments:
509
509
  - 0
510
- hash: 1973744142414396176
510
+ hash: 1832425573722106451
511
511
  requirements: []
512
512
  rubyforge_project:
513
513
  rubygems_version: 1.8.24