Class: HParser::Inline::Comment

Inherits:
Object
  • Object
show all
Includes:
Collectable
Defined in:
lib/hparser/html.rb,
lib/hparser/text.rb,
lib/hparser/latex.rb,
lib/hparser/inline/comment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Comment

Returns a new instance of Comment.



18
19
20
# File 'lib/hparser/inline/comment.rb', line 18

def initialize(content)
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



10
11
12
# File 'lib/hparser/inline/comment.rb', line 10

def content
  @content
end

Class Method Details

.parse(scanner, context = nil) ⇒ Object



12
13
14
15
16
# File 'lib/hparser/inline/comment.rb', line 12

def self.parse(scanner, context=nil)
  if scanner.scan(/<!--.+-->/m)
    self.new(scanner.matched[4..-4])
  end
end

Instance Method Details

#==(o) ⇒ Object



22
23
24
# File 'lib/hparser/inline/comment.rb', line 22

def ==(o)
  o.class == self.class and @content == o.content
end

#to_htmlObject



340
341
342
# File 'lib/hparser/html.rb', line 340

def to_html
  ""
end

#to_latexObject



266
267
268
# File 'lib/hparser/latex.rb', line 266

def to_latex
  ""
end

#to_textObject



174
175
176
# File 'lib/hparser/text.rb', line 174

def to_text
  ""
end