class ParamsReady::Parameter::HashSetParameterBuilder
Public Class Methods
instance(name, altn: nil, type: :boolean)
click to toggle source
# File lib/params_ready/parameter/hash_set_parameter.rb, line 39 def self.instance(name, altn: nil, type: :boolean) new HashSetParameterDefinition.new(name, altn: altn, type: type) end
resolve(type, input, *args, **opts, &block)
click to toggle source
# File lib/params_ready/parameter/hash_set_parameter.rb, line 50 def self.resolve(type, input, *args, **opts, &block) if input.is_a? AbstractDefinition input else define_registered_parameter(type, input, *args, **opts, &block) end end
Public Instance Methods
add(input, *args, val: nil, **opts, &block)
click to toggle source
# File lib/params_ready/parameter/hash_set_parameter.rb, line 43 def add(input, *args, val: nil, **opts, &block) type = @definition.type definition = self.class.resolve(type, input, *args, **opts, &block) @definition.add_child definition, value: val end