Class: HTMLComment
Overview
Class representing an HTML comment
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
Attributes inherited from HTMLToken
Instance Method Summary collapse
-
#initialize(text) ⇒ HTMLComment
constructor
A new instance of HTMLComment.
Methods inherited from HTMLToken
#==, #text, #to_s, #trimmed_text
Constructor Details
#initialize(text) ⇒ HTMLComment
Returns a new instance of HTMLComment.
208 209 210 211 212 213 214 215 216 |
# File 'lib/yadis/htmltokenizer.rb', line 208 def initialize(text) super(text) temp_arr = text.scan(/^<!--\s*(.*?)\s*-->$/m) if temp_arr[0].nil? raise "Text passed to HTMLComment.initialize is not a comment" end @contents = temp_arr[0][0] end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
207 208 209 |
# File 'lib/yadis/htmltokenizer.rb', line 207 def contents @contents end |