Class: Protobuf::EnumValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_class, name, value) ⇒ EnumValue

Returns a new instance of EnumValue.



46
47
48
49
50
51
# File 'lib/protobuf/message/enum.rb', line 46

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



44
45
46
# File 'lib/protobuf/message/enum.rb', line 44

def name
  @name
end

#parent_classObject (readonly)

Returns the value of attribute parent_class.



44
45
46
# File 'lib/protobuf/message/enum.rb', line 44

def parent_class
  @parent_class
end

#valueObject (readonly)

Returns the value of attribute value.



44
45
46
# File 'lib/protobuf/message/enum.rb', line 44

def value
  @value
end

Instance Method Details

#inspectObject



57
58
59
# File 'lib/protobuf/message/enum.rb', line 57

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

#to_sObject



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

def to_s
  @name.to_s
end