module GrnMini::Util

Public Instance Methods

group_with_sort(table, column) click to toggle source
# File lib/grn_mini/util.rb, line 7
def group_with_sort(table, column)
  table.group(column).sort_by {|record| record.n_sub_records }.reverse
end
html_snippet_from_selection_results(table, open_tag = '<strong>', close_tag = "</strong>") click to toggle source
# File lib/grn_mini/util.rb, line 15
def html_snippet_from_selection_results(table, open_tag = '<strong>', close_tag = "</strong>")
  table.expression.snippet([[open_tag, close_tag]], {html_escape: true, normalize: true})
end
text_snippet_from_selection_results(table, open_tag = '<<', close_tag = ">>") click to toggle source
# File lib/grn_mini/util.rb, line 11
def text_snippet_from_selection_results(table, open_tag = '<<', close_tag = ">>")
  table.expression.snippet([[open_tag, close_tag]], {normalize: true})
end