Class: KRPC::Types::EnumType
Instance Attribute Summary collapse
-
#enum_name ⇒ Object
readonly
Returns the value of attribute enum_name.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
Attributes inherited from TypeBase
Instance Method Summary collapse
-
#initialize(pb_type) ⇒ EnumType
constructor
A new instance of EnumType.
- #set_values(values) ⇒ Object
Constructor Details
#initialize(pb_type) ⇒ EnumType
Returns a new instance of EnumType.
102 103 104 105 106 |
# File 'lib/krpc/types.rb', line 102 def initialize(pb_type) @service_name, @enum_name = pb_type.service, pb_type.name # Sets ruby_type to nil, set_values must be called to set the ruby_type super(pb_type, nil) end |
Instance Attribute Details
#enum_name ⇒ Object (readonly)
Returns the value of attribute enum_name.
101 102 103 |
# File 'lib/krpc/types.rb', line 101 def enum_name @enum_name end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
101 102 103 |
# File 'lib/krpc/types.rb', line 101 def service_name @service_name end |
Instance Method Details
#set_values(values) ⇒ Object
108 109 110 |
# File 'lib/krpc/types.rb', line 108 def set_values(values) @ruby_type = Gen.generate_enum(service_name, enum_name, values) end |