Class: Bake::Types::Tuple
- Inherits:
-
Object
- Object
- Bake::Types::Tuple
- Includes:
- Type
- Defined in:
- lib/bake/types/tuple.rb
Instance Method Summary collapse
- #composite? ⇒ Boolean
-
#initialize(item_types) ⇒ Tuple
constructor
A new instance of Tuple.
- #parse(input) ⇒ Object
- #to_s ⇒ Object
Methods included from Type
Constructor Details
#initialize(item_types) ⇒ Tuple
Returns a new instance of Tuple.
28 29 30 |
# File 'lib/bake/types/tuple.rb', line 28 def initialize(item_types) @item_types = item_types end |
Instance Method Details
#parse(input) ⇒ Object
36 37 38 |
# File 'lib/bake/types/tuple.rb', line 36 def parse(input) input.split(',').map{|value| @item_type.parse(value)} end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/bake/types/tuple.rb', line 40 def to_s "a Tuple of (#{@item_types.join(', ')})" end |