Class: ProsemirrorToHtml::Marks::Mark

Inherits:
Object
  • Object
show all
Defined in:
lib/prosemirror_to_html/marks/mark.rb

Direct Known Subclasses

Bold, Code, Italic, Link, Strike, Subscript, Superscript, Underline

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mark) ⇒ Mark

Returns a new instance of Mark.



11
12
13
# File 'lib/prosemirror_to_html/marks/mark.rb', line 11

def initialize(mark)
  @mark = mark
end

Class Attribute Details

.mark_typeObject (readonly)

Returns the value of attribute mark_type.



8
9
10
# File 'lib/prosemirror_to_html/marks/mark.rb', line 8

def mark_type
  @mark_type
end

.tag_nameObject (readonly)

Returns the value of attribute tag_name.



8
9
10
# File 'lib/prosemirror_to_html/marks/mark.rb', line 8

def tag_name
  @tag_name
end

Instance Method Details

#matchingObject



15
16
17
18
19
# File 'lib/prosemirror_to_html/marks/mark.rb', line 15

def matching
  return @mark.type == self.class.mark_type if @mark.type

  false
end

#tagObject



21
22
23
# File 'lib/prosemirror_to_html/marks/mark.rb', line 21

def tag
  self.class.tag_name
end