Class: ParamsReady::Query::ArrayGroupingBuilder

Inherits:
Builder show all
Includes:
Parameter::AbstractStructParameterBuilder::StructLike
Defined in:
lib/params_ready/query/array_grouping.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Parameter::AbstractStructParameterBuilder::StructLike

#add

Methods inherited from Builder

#helper

Methods inherited from AbstractBuilder

#build, builder, define_parameter, define_registered_parameter, #fetch, fetch_builder, #include, #initialize, #open?, register, register_deprecated, resolve

Methods included from Extensions::Registry

#human_string, #registry

Constructor Details

This class inherits a constructor from ParamsReady::AbstractBuilder

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