Class: Protobuf::EnumValue

Inherits:
Fixnum
  • Object
show all
Defined in:
lib/protobuf/message/enum.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (EnumValue) initialize(parent_class, name, value)



53
54
55
56
57
58
# File 'lib/protobuf/message/enum.rb', line 53

def initialize(parent_class, name, value)
  @parent_class = parent_class
  @name = name
  @value = value
  super(@value)
end

Instance Attribute Details

- (Object) name (readonly)

Returns the value of attribute name



51
52
53
# File 'lib/protobuf/message/enum.rb', line 51

def name
  @name
end

- (Object) parent_class (readonly)

Returns the value of attribute parent_class



51
52
53
# File 'lib/protobuf/message/enum.rb', line 51

def parent_class
  @parent_class
end

- (Object) value (readonly)

Returns the value of attribute value



51
52
53
# File 'lib/protobuf/message/enum.rb', line 51

def value
  @value
end

Instance Method Details

- (Object) inspect



64
65
66
# File 'lib/protobuf/message/enum.rb', line 64

def inspect
  "\#<#{self.class} #{@parent_class}::#{@name}=#{@value}>"
end

- (Object) to_s



60
61
62
# File 'lib/protobuf/message/enum.rb', line 60

def to_s
  @name.to_s
end