Class: Bake::Types::Array
- Inherits:
-
Object
- Object
- Bake::Types::Array
- Includes:
- Type
- Defined in:
- lib/bake/types/array.rb
Instance Method Summary collapse
- #composite? ⇒ Boolean
-
#initialize(item_type) ⇒ Array
constructor
A new instance of Array.
- #parse(input) ⇒ Object
- #to_s ⇒ Object
Methods included from Type
Constructor Details
#initialize(item_type) ⇒ Array
Returns a new instance of Array.
28 29 30 |
# File 'lib/bake/types/array.rb', line 28 def initialize(item_type) @item_type = item_type end |
Instance Method Details
#parse(input) ⇒ Object
36 37 38 |
# File 'lib/bake/types/array.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/array.rb', line 40 def to_s "an Array of #{@item_type}" end |