Class: Hashmake::ArrayArgSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/hashmake/array_arg_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hashed_args = {}) ⇒ ArrayArgSpec

Returns a new instance of ArrayArgSpec.



8
9
10
11
# File 'lib/hashmake/array_arg_spec.rb', line 8

def initialize hashed_args = {}
  hashed_args = { :default => ->(){ [] } }.merge hashed_args
  @arg_spec = ArgSpec.new hashed_args
end

Instance Attribute Details

#arg_specObject (readonly)

Returns the value of attribute arg_spec.



6
7
8
# File 'lib/hashmake/array_arg_spec.rb', line 6

def arg_spec
  @arg_spec
end

Instance Method Details

#defaultObject



25
26
27
# File 'lib/hashmake/array_arg_spec.rb', line 25

def default
  @arg_spec.default
end

#reqdObject



21
22
23
# File 'lib/hashmake/array_arg_spec.rb', line 21

def reqd
  @arg_spec.reqd
end

#typeObject



13
14
15
# File 'lib/hashmake/array_arg_spec.rb', line 13

def type
  @arg_spec.type
end

#validate_value(val) ⇒ Object



29
30
31
32
33
# File 'lib/hashmake/array_arg_spec.rb', line 29

def validate_value val
  val.each do |item|
    @arg_spec.validate_value item
  end
end

#validatorObject



17
18
19
# File 'lib/hashmake/array_arg_spec.rb', line 17

def validator
  @arg_spec.validator
end