helpers.rb
# Used in the sections helper to determine if most of the other
# items in the same list that the sections is in, are bullet
# points. If so then the section can be treated as bullet points
# even if it doesn't look like one.
Used in the sections helper to determine if most of the other
items in the same list that the sections is in, are bullet
points. If so then the section can be treated as bullet points
even if it doesn't look like one.
Used in the sections helper to determine if most of the other items in the same list that the sections is in are bullet points . If so then the section can be treated as bullet points even if it doesn ' t look like one .
def most_near_are_points?(near_items)
    near_sections = near_items.map {|n| sections n, []}.flatten 1
    near_sections.select {|n| n.is_a? Array}.size > near_sections.size / 2
  end
def most_near_are_points? ( near_items ) near_sections = near_items . map { | n | sections n , [ ] } . flatten 1 near_sections . select { | n | n . is_a? Array } . size > near_sections . size / 2 end
Used in the sections helper to determine if most of the other
items in the same list that the sections is in, are bullet
points.
Used in the sections helper to determine if most of the other items in the same list that the sections is in are bullet points .
# Convert all the items to a flat list of sections. # Return true if more than half the sections are bullet points.
near_items
<not_specific>