protobuf 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,11 @@ module Protobuf
6
6
 
7
7
  attr_reader :parent_class, :name, :value
8
8
 
9
+ # Overriding the class so ActiveRecord/Arel visitor will visit the enum as a Fixnum
10
+ def class
11
+ Fixnum
12
+ end
13
+
9
14
  def initialize(parent_class, name, value)
10
15
  @parent_class = parent_class
11
16
  @name = name
@@ -14,7 +19,7 @@ module Protobuf
14
19
  end
15
20
 
16
21
  def inspect
17
- "\#<#{self.class} #{@parent_class}::#{@name}=#{@value}>"
22
+ "\#<Protobuf::EnumValue #{@parent_class}::#{@name}=#{@value}>"
18
23
  end
19
24
 
20
25
  def to_hash_value
@@ -22,7 +27,7 @@ module Protobuf
22
27
  end
23
28
 
24
29
  def to_s
25
- @name.to_s
30
+ to_hash_value.to_s
26
31
  end
27
32
  end
28
33
  end
@@ -1,4 +1,4 @@
1
1
  module Protobuf
2
- VERSION = '2.1.2'
2
+ VERSION = '2.1.3'
3
3
  PROTOC_VERSION = '2.4.1'
4
4
  end
@@ -3,11 +3,12 @@ require 'spec_helper'
3
3
  describe Protobuf::EnumValue do
4
4
 
5
5
  subject { Test::EnumTestType::ONE }
6
+ its(:class) { should eq Fixnum }
6
7
  its(:parent_class) { should eq Test::EnumTestType }
7
8
  its(:name) { should eq :ONE }
8
9
  its(:value) { should eq 1 }
9
10
  its(:to_hash_value) { should eq 1 }
10
- its(:to_s) { should eq "ONE" }
11
+ its(:to_s) { should eq "1" }
11
12
  its(:inspect) { should eq '#<Protobuf::EnumValue Test::EnumTestType::ONE=1>' }
12
13
 
13
14
  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.1.2
4
+ version: 2.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-07 00:00:00.000000000 Z
13
+ date: 2012-11-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -516,7 +516,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
516
516
  version: '0'
517
517
  segments:
518
518
  - 0
519
- hash: 2044720871267404005
519
+ hash: 324802600983446856
520
520
  required_rubygems_version: !ruby/object:Gem::Requirement
521
521
  none: false
522
522
  requirements:
@@ -525,7 +525,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
525
525
  version: '0'
526
526
  segments:
527
527
  - 0
528
- hash: 2044720871267404005
528
+ hash: 324802600983446856
529
529
  requirements: []
530
530
  rubyforge_project:
531
531
  rubygems_version: 1.8.24