Class: Bake::Types::Array
- Inherits:
-
Object
- Object
- Bake::Types::Array
- 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
Constructor Details
#initialize(item_type) ⇒ Array
Returns a new instance of Array.
26 27 28 |
# File 'lib/bake/types/array.rb', line 26 def initialize(item_type) @item_type = item_type end |
Instance Method Details
#composite? ⇒ Boolean
30 31 32 |
# File 'lib/bake/types/array.rb', line 30 def composite? true end |
#parse(input) ⇒ Object
34 35 36 |
# File 'lib/bake/types/array.rb', line 34 def parse(input) input.split(',').map{|value| @item_type.parse(value)} end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/bake/types/array.rb', line 38 def to_s "an Array of #{@item_type}" end |