Skip to content

Commit

Permalink
change from singleton_class.ancestors.include? to is_a? for ProtocolB…
Browse files Browse the repository at this point in the history
…uffers::Enum
  • Loading branch information
bufdev committed Aug 9, 2013
1 parent fb84df3 commit 381a73f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/protocol_buffers/runtime/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def self.create(sender, otype, type, name, tag, opts = {})
klass = Field.const_get("#{type.to_s.capitalize}Field") rescue nil
raise("Type not found: #{type}") if klass.nil?
field = klass.new(otype, name, tag, opts)
elsif type.singleton_class.ancestors.include?(ProtocolBuffers::Enum)
elsif type.is_a?(ProtocolBuffers::Enum)
field = Field::EnumField.new(type, otype, name, tag, opts)
elsif type.ancestors.include?(ProtocolBuffers::Message)
if opts[:group]
Expand Down

0 comments on commit 381a73f

Please sign in to comment.