Module: Ace::Bundle::Atoms::ContentChecker
- Defined in:
- lib/ace/bundle/atoms/content_checker.rb
Overview
Pure functions for checking section content types Used by both SectionProcessor and ContextLoader
Class Method Summary collapse
-
.has_commands_content?(section_data) ⇒ Boolean
Checks if section has commands content.
-
.has_content_content?(section_data) ⇒ Boolean
Checks if section has inline content.
-
.has_diffs_content?(section_data) ⇒ Boolean
Checks if section has diffs content Note: For _processed_diffs, we check for non-empty arrays to avoid treating empty arrays as valid diff content (which would trigger merge logic unnecessarily).
-
.has_files_content?(section_data) ⇒ Boolean
Checks if section has files content.
Class Method Details
.has_commands_content?(section_data) ⇒ Boolean
Checks if section has commands content
32 33 34 |
# File 'lib/ace/bundle/atoms/content_checker.rb', line 32 def has_commands_content?(section_data) !!(section_data[:commands] || section_data["commands"]) end |
.has_content_content?(section_data) ⇒ Boolean
Checks if section has inline content
39 40 41 |
# File 'lib/ace/bundle/atoms/content_checker.rb', line 39 def has_content_content?(section_data) !!(section_data[:content] || section_data["content"]) end |
.has_diffs_content?(section_data) ⇒ Boolean
Checks if section has diffs content Note: For _processed_diffs, we check for non-empty arrays to avoid treating empty arrays as valid diff content (which would trigger merge logic unnecessarily)
15 16 17 18 19 20 |
# File 'lib/ace/bundle/atoms/content_checker.rb', line 15 def has_diffs_content?(section_data) ranges = section_data[:ranges] || section_data["ranges"] diffs = section_data[:diffs] || section_data["diffs"] processed_diffs = section_data[:_processed_diffs] || section_data["_processed_diffs"] !!(ranges || diffs || (processed_diffs.is_a?(Array) && processed_diffs.any?)) end |
.has_files_content?(section_data) ⇒ Boolean
Checks if section has files content
25 26 27 |
# File 'lib/ace/bundle/atoms/content_checker.rb', line 25 def has_files_content?(section_data) !!(section_data[:files] || section_data["files"]) end |