require "tree_html/version" module TreeHtml NO_DATA_IN_A = {}.freeze NO_CHECKBOX = "".freeze BLANK = ''.freeze def tree_html "" end def tree_html_full ""\ ""\ "#{tree_html}"\ "" end Css = File.expand_path('../tree_html/tree_html.css', __FILE__) def main_css_for_tree_html File.read(Css) end protected def li_for_tree_html "
  • #{checkbox_for_tree_html}#{label_for_tree_html}#{sub_ul_for_tree_html}
  • " end def data_in_a_for_tree_html data_for_tree_html.map{ |k, v| "data-#{k}='#{v}'" }.join(" ") end def data_for_tree_html NO_DATA_IN_A end def checkbox_for_tree_html if children_for_tree_html.empty? NO_CHECKBOX else "" end end def sub_ul_for_tree_html if children_for_tree_html.empty? BLANK else "" end end def css_for_tree_html BLANK end end