module SearchReport
Constants
- STYLE_BANNER
Public Instance Methods
Source
# File lib/search_report.rb, line 21 def card(tag:, title:, body_lines:, footer_parts:, heading_style: STYLE_BANNER) IrcReply.card( tag: tag, title: title, body_lines: body_lines, footer_parts: footer_parts, heading_style: heading_style ) end
Source
# File lib/search_report.rb, line 36 def colon_body_lines(rows) TextAlign.format_colon_rows(Array(rows)) end
Source
# File lib/search_report.rb, line 91 def config_error_card(tag:, title:, body_lines:, footer_parts:, heading_style: STYLE_BANNER) card( tag: tag, title: title, body_lines: body_lines, footer_parts: footer_parts, heading_style: heading_style ) end
Source
# File lib/search_report.rb, line 47 def empty_report(tag:, query:, total:, empty_lines:, footer_parts:, comma_count: false, heading_style: STYLE_BANNER) card( tag: tag, title: heading(query: query, total: total, comma_count: comma_count), body_lines: empty_lines, footer_parts: footer_parts, heading_style: heading_style ) end
Source
# File lib/search_report.rb, line 79 def fetch_error_card(tag:, query:, error_lines:, footer_parts:, fallback_title: nil, heading_style: STYLE_BANNER) title = query.to_s.strip.empty? ? fallback_title : query.to_s.strip card( tag: tag, title: title, body_lines: error_lines, footer_parts: footer_parts, heading_style: heading_style ) end
Source
# File lib/search_report.rb, line 31 def heading(query:, total:, comma_count: false) count_label = TextUtil.format_count(total, comma: comma_count) "#{query} ยท #{count_label}" end
Source
# File lib/search_report.rb, line 40 def list_item_line(index:, title:, detail_parts:, url: nil) detail = Array(detail_parts).map(&:to_s).reject(&:empty?).join(" ยท ") line = detail.empty? ? "#{index}. #{title}" : "#{index}. #{title} โ #{detail}" url_text = url.to_s.strip url_text.empty? ? line : "#{line} (#{url_text})" end
Source
# File lib/search_report.rb, line 58 def results_report(tag:, query:, total:, body_lines:, footer_parts:, comma_count: false, heading_style: STYLE_BANNER) card( tag: tag, title: heading(query: query, total: total, comma_count: comma_count), body_lines: body_lines, footer_parts: footer_parts, heading_style: heading_style ) end
Source
# File lib/search_report.rb, line 69 def usage_card(tag:, title:, usage_message:, footer_parts:, heading_style: STYLE_BANNER) card( tag: tag, title: title, body_lines: [usage_message], footer_parts: footer_parts, heading_style: heading_style ) end