Class: ProsemirrorToHtml::Nodes::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/prosemirror_to_html/nodes/node.rb

Class Attribute Summary collapse

Instance Method Summary collapse

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_typeObject (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_nameObject (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

#matchingObject



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_closingObject



21
22
23
# File 'lib/prosemirror_to_html/nodes/node.rb', line 21

def self_closing
  false
end

#tagObject



25
26
27
# File 'lib/prosemirror_to_html/nodes/node.rb', line 25

def tag
  self.class.tag_name
end

#textObject



29
30
31
# File 'lib/prosemirror_to_html/nodes/node.rb', line 29

def text
  nil
end