Class: KRPC::Types::ListType

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

Instance Attribute Summary collapse

Attributes inherited from TypeBase

#protobuf_type, #ruby_type

Instance Method Summary collapse

Constructor Details

#initialize(type_string) ⇒ ListType

Returns a new instance of ListType.

Raises:



186
187
188
189
190
191
# File 'lib/krpc/types.rb', line 186

def initialize(type_string)
  m = /^List\((.+)\)$/.match type_string
  raise(ValueError, "\"#{type_string}\" is not a valid type string for a list type") unless m
  @value_type = TypeStore[m[1]]
  super(type_string, Array)
end

Instance Attribute Details

#value_typeObject (readonly)

Returns the value of attribute value_type.



185
186
187
# File 'lib/krpc/types.rb', line 185

def value_type
  @value_type
end