Class: KRPC::Types::TupleType
Instance Attribute Summary collapse
-
#value_types ⇒ Object
readonly
Returns the value of attribute value_types.
Attributes inherited from TypeBase
Instance Method Summary collapse
-
#initialize(type_string) ⇒ TupleType
constructor
A new instance of TupleType.
Constructor Details
#initialize(type_string) ⇒ TupleType
Returns a new instance of TupleType.
222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/krpc/types.rb', line 222 def initialize(type_string) m = /^Tuple\((.+)\)$/.match type_string raise(ValueError, "\"#{type_string}\" is not a valid type string for a tuple type") unless m @value_types = [] type = m[1] until type.nil? value_type, type = parse_type_string(type) @value_types << TypeStore[value_type] end super(type_string, Array) end |
Instance Attribute Details
#value_types ⇒ Object (readonly)
Returns the value of attribute value_types.
221 222 223 |
# File 'lib/krpc/types.rb', line 221 def value_types @value_types end |