Class: ParamsReady::Parameter::PolymorphParameterBuilder
Class Method Summary
collapse
Instance Method Summary
collapse
#marshal
Methods inherited from Builder
#helper
#build, builder, define_parameter, define_registered_parameter, #fetch, fetch_builder, #include, #initialize, #open?, register, register_deprecated, resolve
#human_string, #registry
Class Method Details
.instance(name, altn: nil) ⇒ Object
80
81
82
|
# File 'lib/params_ready/parameter/polymorph_parameter.rb', line 80
def self.instance(name, altn: nil)
new PolymorphParameterDefinition.new(name, altn: altn)
end
|
Instance Method Details
#identifier(identifier) ⇒ Object
89
90
91
|
# File 'lib/params_ready/parameter/polymorph_parameter.rb', line 89
def identifier(identifier)
@definition.set_identifier identifier
end
|
#type(input, *args, **opts, &block) ⇒ Object
84
85
86
87
|
# File 'lib/params_ready/parameter/polymorph_parameter.rb', line 84
def type(input, *args, **opts, &block)
definition = self.class.resolve(input, *args, **opts, &block)
@definition.add_type definition
end
|