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.



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

#contentsObject

Returns the value of attribute contents.



210
211
212
# File 'lib/openid/yadis/htmltokenizer.rb', line 210

def contents
  @contents
end