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.
211 212 213 214 215 216 217 218 219 |
# File 'lib/openid/yadis/htmltokenizer.rb', line 211 def initialize(text) super(text) temp_arr = text.scan(/^<!--\s*(.*?)\s*-->$/m) if temp_arr[0].nil? raise HTMLTokenizerError, "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.
210 211 212 |
# File 'lib/openid/yadis/htmltokenizer.rb', line 210 def contents @contents end |