lib/doc_template/objects/toc_metadata.rb in lcms-engine-0.3.0 vs lib/doc_template/objects/toc_metadata.rb in lcms-engine-0.3.1

- old
+ new

@@ -16,19 +16,19 @@ attribute :priority, Integer, default: 0 attribute :standard, String, default: '' attribute :time, Integer, default: 0 attribute :title, String - def excluded?(excludes, ela = false) + def excluded?(excludes, ela: false) # Do not exclude parent if all children are optional and deselected return false if ela && children.all?(&:optional) return excludes.exclude?(anchor) if optional return true if excludes.include?(anchor) children.any? && children.all? { |c| c.excluded?(excludes) } end - def time_with(excludes) + def time_with(excludes) # rubocop:disable Metrics/PerceivedComplexity # Optional and nothing to exclude explicitly return excludes.include?(anchor) ? time : 0 if optional # General and excluded explicitly return 0 if excludes.include?(anchor)