Class: ODDB::HtmlAttributesHandler

Inherits:
Object
  • Object
show all
Defined in:
src/util/html_parser.rb

Direct Known Subclasses

HtmlFontHandler, HtmlLinkHandler

Instance Method Summary (collapse)

Constructor Details

- (HtmlAttributesHandler) initialize(attr)

A new instance of HtmlAttributesHandler



421
422
423
424
425
426
427
# File 'src/util/html_parser.rb', line 421

def initialize(attr)
  @attributes = attr.inject({}) { |inj, pair| 
    key, val = pair
    inj.store(key.downcase, val.gsub(/["']/u, ''))
    inj
  }
end

Instance Method Details

- (Object) attribute(key)



428
429
430
# File 'src/util/html_parser.rb', line 428

def attribute(key)
  @attributes[key.downcase]
end