Sha256: d77c3ee49ccf7af6ad5d35e9c7046b4b87e5e875e03a9bad133433edb1607808
Contents?: true
Size: 573 Bytes
Versions: 5
Compression:
Stored size: 573 Bytes
Contents
require 'protobuf/descriptor/enum_descriptor' require 'protobuf/message/protoable' module Protobuf class Enum class <<self include Protobuf::Protoable def get_name_by_tag(tag) constants.find do |name| const_get(name) == tag end end def valid_tag?(tag) not get_name_by_tag(tag).nil? end def name_by_value(value) constants.find {|c| const_get(c) == value} end def descriptor @descriptor ||= Protobuf::Descriptor::EnumDescriptor.new(self) end end end end
Version data entries
5 entries across 5 versions & 2 rubygems