Class: ParamsReady::Query::PolymorphPredicateBuilder
Class Method Summary
collapse
Instance Method Summary
collapse
#human_string, #registry
#build, builder, define_parameter, define_registered_parameter, #fetch, fetch_builder, #include, #initialize, #open?, register, register_deprecated, resolve
Class Method Details
.instance(name, altn: nil) ⇒ Object
35
36
37
|
# File 'lib/params_ready/query/polymorph_predicate.rb', line 35
def self.instance(name, altn: nil)
new PolymorphPredicateDefinition.new name, altn: altn
end
|
Instance Method Details
#identifier(identifier) ⇒ Object
46
47
48
|
# File 'lib/params_ready/query/polymorph_predicate.rb', line 46
def identifier(identifier)
@definition.set_identifier(identifier)
end
|
#type(type_name, *args, **opts, &block) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/params_ready/query/polymorph_predicate.rb', line 39
def type(type_name, *args, **opts, &block)
builder = PredicateRegistry.predicate(type_name).instance(*args, **opts)
builder.instance_eval(&block) unless block.nil?
type = builder.build
@definition.add_type type
end
|