Class: ProsemirrorToHtml::Nodes::Node
- Inherits:
-
Object
- Object
- ProsemirrorToHtml::Nodes::Node
- Defined in:
- lib/prosemirror_to_html/nodes/node.rb
Direct Known Subclasses
Blockquote, BulletList, CodeBlock, HardBreak, Heading, HorizontalRule, Image, ListItem, OrderedList, Paragraph, Table, TableCell, TableRow
Class Attribute Summary collapse
-
.node_type ⇒ Object
readonly
Returns the value of attribute node_type.
-
.tag_name ⇒ Object
readonly
Returns the value of attribute tag_name.
Instance Method Summary collapse
-
#initialize(node) ⇒ Node
constructor
A new instance of Node.
- #matching ⇒ Object
- #self_closing ⇒ Object
- #tag ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(node) ⇒ Node
Returns a new instance of Node.
11 12 13 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 11 def initialize(node) @node = node end |
Class Attribute Details
.node_type ⇒ Object (readonly)
Returns the value of attribute node_type.
8 9 10 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 8 def node_type @node_type end |
.tag_name ⇒ Object (readonly)
Returns the value of attribute tag_name.
8 9 10 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 8 def tag_name @tag_name end |
Instance Method Details
#matching ⇒ Object
15 16 17 18 19 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 15 def matching return underscore(@node.type) == self.class.node_type if @node.type false end |
#self_closing ⇒ Object
21 22 23 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 21 def self_closing false end |
#tag ⇒ Object
25 26 27 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 25 def tag self.class.tag_name end |
#text ⇒ Object
29 30 31 |
# File 'lib/prosemirror_to_html/nodes/node.rb', line 29 def text nil end |