Class: Arrow::HTMLComment
- Defined in:
- lib/arrow/htmltokenizer.rb
Overview
Class for tokens output by Arrow::HTMLTokenizer for HTML comments.
Constant Summary collapse
- CommentPattern =
:nodoc:
/^<!--((?:[^-]|-(?!-))*)-->$/
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
Attributes inherited from HTMLToken
Instance Method Summary collapse
-
#initialize(raw) ⇒ HTMLComment
constructor
A new instance of HTMLComment.
Methods inherited from HTMLToken
#css_class, #escape_html, #to_html
Methods inherited from Object
deprecate_class_method, deprecate_method, inherited
Constructor Details
#initialize(raw) ⇒ HTMLComment
Returns a new instance of HTMLComment.
182 183 184 185 186 187 188 189 190 191 |
# File 'lib/arrow/htmltokenizer.rb', line 182 def initialize( raw ) super unless (( match = CommentPattern.match(raw) )) raise ArgumentError, "Malformed comment %p" % raw end @contents = match[1] end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
193 194 195 |
# File 'lib/arrow/htmltokenizer.rb', line 193 def contents @contents end |