Class: ImageElements::Image

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

Overview

A Image element.

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Image

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



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

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