Class: MDOM::List

Inherits:
BlockNode show all
Defined in:
lib/mdom/nodes.rb

Instance Attribute Summary

Attributes inherited from Node

#attributes, #children, #parent, #type

Instance Method Summary collapse

Methods inherited from Node

#[], #ancestors, #append, #children?, #depth, #each_child, #empty?, #find, #find_all, #insert_after, #insert_before, #inspect, #plain_text, #pretty_print, #remove, #replace, #root, #text?, #to_markdown, #to_s, #walk

Constructor Details

#initialize(ordered: false, tight: true, start: nil, children: [], attributes: {}) ⇒ List

ordered: true/false, tight: true/false, start: integer for ordered lists



56
57
58
59
60
# File 'lib/mdom/nodes.rb', line 56

def initialize(ordered: false, tight: true, start: nil, children: [], attributes: {})
  attrs = { ordered: ordered, tight: tight }.merge(attributes)
  attrs[:start] = start unless start.nil?
  super(Types::LIST, attributes: attrs, children: children)
end

Instance Method Details

#ordered?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/mdom/nodes.rb', line 62

def ordered?
  attributes[:ordered]
end