add Item#closed_items

This commit is contained in:
Josh Holtrop 2021-08-28 09:47:01 -04:00
parent d931bcb513
commit e4f2fffe50
2 changed files with 11 additions and 2 deletions

View File

@ -27,6 +27,16 @@ class Imbecile
self == other
end
def closed_items
if @rule.components[@position].is_a?(Array)
@rule.components[@position].map do |rule|
Item.new(rule, 0)
end
else
[]
end
end
end
end

View File

@ -13,8 +13,7 @@ class Imbecile
this_eval_items = eval_items
eval_items = Set.new
this_eval_items.each do |item|
if item.next_component.is_a?(Rule)
end
eval_items += item.closed_items
end
@items += eval_items
end