Class: Hecks::Bluebook::Expression::Resolver::Find
- Inherits:
-
Struct
- Object
- Struct
- Hecks::Bluebook::Expression::Resolver::Find
- Defined in:
- lib/hecks/bluebook/expression/resolver/block_predicates.rb
Overview
receiver.find { |x| PREDICATE } / .find { ... }.a.b -- the
"find-then-project" shape the shipping domain's re-routing
rules kept reaching for by hand (a caller-precomputed
next_load_location field standing in for "the leg after this
one", because BlockPredicate above can only answer yes/no,
never hand back the element it found). path holds the
dotted segments walked past the closing }, e.g. the [" next_load_location"] in legs.find { |l| l.load_location == x }.next_load_location -- empty when .find { ... } is used
bare (its own found-element-or-nil is the value, same as any
other leaf, e.g. composed with .present? the same way every
other receiver already composes with it). Reuses param/
predicate's exact field names from BlockPredicate on
purpose: interpret_with_element below binds by those two
names and is shared unchanged between both node types.
Instance Attribute Summary collapse
-
#param ⇒ Object
Returns the value of attribute param.
-
#path ⇒ Object
Returns the value of attribute path.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Attribute Details
#param ⇒ Object
Returns the value of attribute param
72 73 74 |
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72 def param @param end |
#path ⇒ Object
Returns the value of attribute path
72 73 74 |
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72 def path @path end |
#predicate ⇒ Object
Returns the value of attribute predicate
72 73 74 |
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72 def predicate @predicate end |
#receiver ⇒ Object
Returns the value of attribute receiver
72 73 74 |
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72 def receiver @receiver end |