Class: KRPC::Types::MessageType

Inherits:
TypeBase
  • Object
show all
Defined in:
lib/krpc/types.rb

Instance Attribute Summary

Attributes inherited from TypeBase

#protobuf_type, #ruby_type

Instance Method Summary collapse

Constructor Details

#initialize(type_string) ⇒ MessageType

Returns a new instance of MessageType.



150
151
152
153
154
155
156
# File 'lib/krpc/types.rb', line 150

def initialize(type_string)
  if PROTOBUF_TO_MESSAGE_TYPE.has_key? type_string
    super(type_string, PROTOBUF_TO_MESSAGE_TYPE[type_string])
  else
    raise(ValueError, "\"#{type_string}\" is not a valid type string for a message type")
  end
end