Class: Hecks::Bluebook::Expression::Resolver::Find

Inherits:
Struct
  • Object
show all
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

Instance Attribute Details

#paramObject

Returns the value of attribute param

Returns:

  • (Object)

    the current value of param



72
73
74
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72

def param
  @param
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



72
73
74
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72

def path
  @path
end

#predicateObject

Returns the value of attribute predicate

Returns:

  • (Object)

    the current value of predicate



72
73
74
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72

def predicate
  @predicate
end

#receiverObject

Returns the value of attribute receiver

Returns:

  • (Object)

    the current value of receiver



72
73
74
# File 'lib/hecks/bluebook/expression/resolver/block_predicates.rb', line 72

def receiver
  @receiver
end