Skip to content

Commit

Permalink
alias constants so that :ClassMethods is not included
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Aug 14, 2013
1 parent 78521fe commit b3a330f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/protocol_buffers/runtime/enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module ProtocolBuffers
module Enum

def self.included(clazz)
class << clazz
alias constants_original constants
end
clazz.extend(ClassMethods)
end

Expand Down Expand Up @@ -32,6 +35,10 @@ def name_to_value_map
end
@name_to_value_map
end

def constants
constants_original.delete_if { |constant| constant == :ClassMethods }
end
end
end
end

0 comments on commit b3a330f

Please sign in to comment.