Class: Bake::Types::Array

Inherits:
Object
  • Object
show all
Includes:
Type
Defined in:
lib/bake/types/array.rb

Instance Method Summary collapse

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

#composite?Boolean

Returns:



32
33
34
# File 'lib/bake/types/array.rb', line 32

def composite?
	true
end

#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_sObject



40
41
42
# File 'lib/bake/types/array.rb', line 40

def to_s
	"an Array of #{@item_type}"
end