Class: Protobuf::EnumValue
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Protobuf::EnumValue
- Defined in:
- lib/protobuf/message/enum.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent_class ⇒ Object
readonly
Returns the value of attribute parent_class.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(parent_class, name, value) ⇒ EnumValue
constructor
A new instance of EnumValue.
- #inspect ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
44 45 46 |
# File 'lib/protobuf/message/enum.rb', line 44 def name @name end |
#parent_class ⇒ Object (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 |
#value ⇒ Object (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
#inspect ⇒ Object
57 58 59 |
# File 'lib/protobuf/message/enum.rb', line 57 def inspect "\#<#{self.class} #{@parent_class}::#{@name}=#{@value}>" end |
#to_s ⇒ Object
53 54 55 |
# File 'lib/protobuf/message/enum.rb', line 53 def to_s @name.to_s end |