Class: MDOM::Heading
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Attributes inherited from Node
#attributes, #children, #parent, #type
Instance Method Summary collapse
-
#initialize(level, children: [], attributes: {}) ⇒ Heading
constructor
A new instance of Heading.
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(level, children: [], attributes: {}) ⇒ Heading
Returns a new instance of Heading.
42 43 44 45 |
# File 'lib/mdom/nodes.rb', line 42 def initialize(level, children: [], attributes: {}) @level = level.to_i super(Types::HEADING, attributes: attributes.merge(level: @level), children: children) end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
40 41 42 |
# File 'lib/mdom/nodes.rb', line 40 def level @level end |