Skip to content

Commit

Permalink
change name/value mappings to use only symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Aug 17, 2013
1 parent 8166adb commit d5e5edd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/protocol_buffers/runtime/enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ def value_to_names_map
# values do not have to be unique
value = self.const_get(constant)
hash[value] ||= Array.new
hash[value] << constant
hash[value] << constant.to_sym
hash
end
@value_to_names_map
end

def name_to_value_map
@name_to_value_map ||= self.constants.inject(Hash.new) do |hash, constant|
hash[constant] = self.const_get(constant)
hash[constant.to_sym] = self.const_get(constant)
hash
end
@name_to_value_map
Expand Down

0 comments on commit d5e5edd

Please sign in to comment.