Class: Infoboxer::Tree::ListItem

Inherits:
BaseParagraph show all
Defined in:
lib/infoboxer/tree/list.rb

Overview

Represents item of ordered or unordered list.

Direct Known Subclasses

DDefinition, DTerm

Instance Attribute Summary

Attributes inherited from Compound

#children

Attributes inherited from Node

#params, #parent

Instance Method Summary collapse

Methods inherited from Compound

#index_of, #initialize, #to_tree

Methods inherited from Node

#==, #children, coder, def_readers, #index, #initialize, #inspect, #next_siblings, #prev_siblings, #siblings, #text_, #to_s, #to_tree

Methods included from Navigation::Sections::Node

#in_sections

Methods included from Navigation::Shortcuts::Node

#bold?, #categories, #external_links, #heading?, #headings, #images, #infoboxes, #italic?, #lists, #paragraphs, #tables, #templates, #wikilinks

Methods included from Navigation::Lookup::Node

#_lookup, #_lookup_children, #_lookup_next_siblings, #_lookup_parents, #_lookup_prev_siblings, #_lookup_siblings, #_matches?, #has_parent?, #lookup, #lookup_children, #lookup_next_siblings, #lookup_parents, #lookup_prev_siblings, #lookup_siblings, #matches?

Constructor Details

This class inherits a constructor from Infoboxer::Tree::Compound

Instance Method Details

#textObject



23
24
25
26
27
28
29
# File 'lib/infoboxer/tree/list.rb', line 23

def text
  make_marker + if children.last.is_a?(List)
    children[0..-2].map(&:text).join + "\n" + children.last.text
  else
    children.map(&:text).join + "\n"
  end
end