Class: Kumi::IR::DF::AccessContract
- Inherits:
-
Object
- Object
- Kumi::IR::DF::AccessContract
- Defined in:
- lib/kumi/ir/df/access_contract.rb
Instance Method Summary collapse
-
#initialize(input_table) ⇒ AccessContract
constructor
A new instance of AccessContract.
-
#load_input_chain_for(_node) ⇒ Object
DFIR owns path structure explicitly: - load_input opens the root input key only - load_field instructions represent every remaining path segment Any SNAST key_chain is frontend/access-planner context and must not be duplicated into load_input once DFIR emits the field chain.
- #plan_ref_for!(path_segments) ⇒ Object
- #plans? ⇒ Boolean
Constructor Details
#initialize(input_table) ⇒ AccessContract
Returns a new instance of AccessContract.
7 8 9 |
# File 'lib/kumi/ir/df/access_contract.rb', line 7 def initialize(input_table) @plan_refs = build_plan_refs(input_table) end |
Instance Method Details
#load_input_chain_for(_node) ⇒ Object
DFIR owns path structure explicitly:
-
load_input opens the root input key only
-
load_field instructions represent every remaining path segment
Any SNAST key_chain is frontend/access-planner context and must not be duplicated into load_input once DFIR emits the field chain.
29 30 31 |
# File 'lib/kumi/ir/df/access_contract.rb', line 29 def load_input_chain_for(_node) [] end |
#plan_ref_for!(path_segments) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/kumi/ir/df/access_contract.rb', line 15 def plan_ref_for!(path_segments) return nil unless plans? key = fqn(path_segments) @plan_refs.fetch(key) do raise ArgumentError, "DFIR access contract missing input plan for #{key.inspect}" end end |
#plans? ⇒ Boolean
11 12 13 |
# File 'lib/kumi/ir/df/access_contract.rb', line 11 def plans? !@plan_refs.empty? end |