Method: Arrow::HTMLTag#initialize

Defined in:
lib/arrow/htmltokenizer.rb

#initialize(raw) ⇒ HTMLTag

Create a new HTMLTag from the specified raw source.



216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/arrow/htmltokenizer.rb', line 216

def initialize( raw )
  unless (( match = /<\s*(\/)?(\w+)\s*([^>]*)>/.match(raw) ))
    raise ArgumentError,
      "Malformed HTMLTag: %p" % raw
  end

  @endtag = !match[1].nil?
  @tagname = match[2]
  @rawattrs = match[3] || ''
  @attrs = nil

  super
end