Class: HTMLComment

Inherits:
HTMLToken show all
Defined in:
lib/openid/yadis/htmltokenizer.rb

Overview

Class representing an HTML comment

Instance Attribute Summary collapse

Attributes inherited from HTMLToken

#raw

Instance Method Summary collapse

Methods inherited from HTMLToken

#==, #text, #to_s, #trimmed_text

Constructor Details

#initialize(text) ⇒ HTMLComment

Returns a new instance of HTMLComment.

Raises:



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

#contentsObject

Returns the value of attribute contents.



203
204
205
# File 'lib/openid/yadis/htmltokenizer.rb', line 203

def contents
  @contents
end