Class: ParamsReady::Query::ArrayGroupingBuilder
Class Method Summary
collapse
Instance Method Summary
collapse
#add
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
41
42
43
|
# File 'lib/params_ready/query/array_grouping.rb', line 41
def self.instance(name, altn: nil)
new ArrayGroupingDefinition.new(name, altn: altn)
end
|
Instance Method Details
#operator(&block) ⇒ Object
45
46
47
48
|
# File 'lib/params_ready/query/array_grouping.rb', line 45
def operator(&block)
definition = Builder.define_grouping_operator(:operator, altn: :op, &block)
add definition
end
|
#prototype(type_name, name = :proto, *arr, **opts, &block) ⇒ Object
35
36
37
38
39
|
# File 'lib/params_ready/query/array_grouping.rb', line 35
def prototype(type_name, name = :proto, *arr, **opts, &block)
prototype = PredicateRegistry.predicate(type_name).instance(name, *arr, **opts)
prototype.instance_eval(&block) unless block.nil?
@definition.set_prototype prototype.build
end
|