Class: HTMLComment
- Defined in:
- lib/openid/yadis/htmltokenizer.rb
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.
205 206 207 208 209 210 211 |
# File 'lib/openid/yadis/htmltokenizer.rb', line 205 def initialize(text) super temp_arr = text.scan(/^<!--\s*(.*?)\s*-->$/m) raise HTMLTokenizerError, "Text passed to HTMLComment.initialize is not a comment" if temp_arr[0].nil? @contents = temp_arr[0][0] end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
203 204 205 |
# File 'lib/openid/yadis/htmltokenizer.rb', line 203 def contents @contents end |