Class: Hashmake::HashArgSpec
- Inherits:
-
Object
- Object
- Hashmake::HashArgSpec
- Defined in:
- lib/hashmake/hash_arg_spec.rb
Instance Attribute Summary collapse
-
#arg_spec ⇒ Object
readonly
Returns the value of attribute arg_spec.
Instance Method Summary collapse
- #default ⇒ Object
-
#initialize(hashed_args = {}) ⇒ HashArgSpec
constructor
A new instance of HashArgSpec.
- #reqd ⇒ Object
- #type ⇒ Object
- #validate_value(val) ⇒ Object
- #validator ⇒ Object
Constructor Details
#initialize(hashed_args = {}) ⇒ HashArgSpec
Returns a new instance of HashArgSpec.
8 9 10 11 |
# File 'lib/hashmake/hash_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_spec ⇒ Object (readonly)
Returns the value of attribute arg_spec.
6 7 8 |
# File 'lib/hashmake/hash_arg_spec.rb', line 6 def arg_spec @arg_spec end |
Instance Method Details
#default ⇒ Object
25 26 27 |
# File 'lib/hashmake/hash_arg_spec.rb', line 25 def default @arg_spec.default end |
#reqd ⇒ Object
21 22 23 |
# File 'lib/hashmake/hash_arg_spec.rb', line 21 def reqd @arg_spec.reqd end |
#type ⇒ Object
13 14 15 |
# File 'lib/hashmake/hash_arg_spec.rb', line 13 def type @arg_spec.type end |
#validate_value(val) ⇒ Object
29 30 31 32 33 |
# File 'lib/hashmake/hash_arg_spec.rb', line 29 def validate_value val val.each do |key, item| @arg_spec.validate_value item end end |
#validator ⇒ Object
17 18 19 |
# File 'lib/hashmake/hash_arg_spec.rb', line 17 def validator @arg_spec.validator end |