class Syobocal::Comment::Element::Header2
Attributes
text_node[R]
Public Class Methods
match?(line)
click to toggle source
# File lib/syobocal/comment/element/header2.rb, line 15 def self.match?(line) line.start_with?("**") end
new(text_node)
click to toggle source
# File lib/syobocal/comment/element/header2.rb, line 7 def initialize(text_node) @text_node = text_node end
parse(line)
click to toggle source
# File lib/syobocal/comment/element/header2.rb, line 19 def self.parse(line) txt = line.match(/\A\*\*(.*)\Z/)[1] Element::Header2.new(Element::TextNode.parse(txt)) end
Public Instance Methods
==(other)
click to toggle source
# File lib/syobocal/comment/element/header2.rb, line 11 def ==(other) other.instance_of?(self.class) && other.text_node == text_node end