Class: ParamsReady::Query::StructuredGroupingDefinition
- Inherits:
-
Parameter::StructParameterDefinition
- Object
- Parameter::AbstractDefinition
- Parameter::Definition
- Parameter::AbstractStructParameterDefinition
- Parameter::StructParameterDefinition
- ParamsReady::Query::StructuredGroupingDefinition
- Defined in:
- lib/params_ready/query/structured_grouping.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#arel_table ⇒ Object
readonly
Returns the value of attribute arel_table.
-
#predicates ⇒ Object
readonly
Returns the value of attribute predicates.
Attributes inherited from Parameter::AbstractStructParameterDefinition
Attributes inherited from Parameter::Definition
Attributes inherited from Parameter::AbstractDefinition
Instance Method Summary collapse
- #add_predicate(predicate) ⇒ Object
-
#initialize(*args, **opts) ⇒ StructuredGroupingDefinition
constructor
A new instance of StructuredGroupingDefinition.
Methods inherited from Parameter::StructParameterDefinition
#add_map, #ensure_canonical, #remap?
Methods inherited from Parameter::AbstractStructParameterDefinition
#add_child, #child_definition, #duplicate_value, #freeze_value, #has_child?, #infer_default, #set_default
Methods inherited from Parameter::Definition
#canonical_default, #default_defined?, #fetch_callable_default, #fetch_default, #finish, #memoize?, #name_for_formatter, #no_input?, #no_output?, #postprocess, #preprocess, #restricted_for_format?, #set_local, #set_no_input, #set_postprocessor, #set_preprocessor
Methods inherited from Parameter::AbstractDefinition
#create, #finish, #from_hash, #from_input, #normalize_alternative_name, #parameter_class
Methods included from Extensions::Freezer
#freeze_variable, #freeze_variables, #variables_to_freeze
Methods included from Extensions::Finalizer
Methods included from Extensions::ClassReaderWriter
Methods included from Extensions::LateInit
Methods included from Extensions::Collection
Methods included from Extensions::Finalizer::InstanceMethods
Methods included from Extensions::Freezer::InstanceMethods
Constructor Details
#initialize(*args, **opts) ⇒ StructuredGroupingDefinition
Returns a new instance of StructuredGroupingDefinition.
43 44 45 46 |
# File 'lib/params_ready/query/structured_grouping.rb', line 43 def initialize(*args, **opts) @predicates = {} super *args, **opts end |
Instance Attribute Details
#arel_table ⇒ Object (readonly)
Returns the value of attribute arel_table.
41 42 43 |
# File 'lib/params_ready/query/structured_grouping.rb', line 41 def arel_table @arel_table end |
#predicates ⇒ Object (readonly)
Returns the value of attribute predicates.
41 42 43 |
# File 'lib/params_ready/query/structured_grouping.rb', line 41 def predicates @predicates end |
Instance Method Details
#add_predicate(predicate) ⇒ Object
48 49 50 51 |
# File 'lib/params_ready/query/structured_grouping.rb', line 48 def add_predicate(predicate) raise ParamsReadyError, "Predicate name taken: '#{predicate.name}" if predicates.key? predicate.name predicates[predicate.name] = predicate end |