Class: LinkElements::Link

Inherits:
Element
  • Object
show all
Defined in:
lib/reparcs/elements/link_elements.rb

Overview

A link element ‘<link />’

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Link

Creates a new Link element, takes an optional hash of attributes as parameter.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/reparcs/elements/link_elements.rb', line 10

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "charset", "dir",
    "hreflang", "xml:lang", "onclick", "ondblclick",
    "onkeydown", "onkeypress", "onkeyup", "onmousedown",
    "onmousemove", "onmouseout", "onmouseover", "onmouseup",
    "style", "href", "media", "rel", "rev", "type"
  ]
  super("link", aattrs, attrs)
  @start_element = "<link"
  @end_element = " />"
end