Class: WebUnit::Image

Inherits:
HtmlElem show all
Defined in:
lib/webunit/image.rb

Instance Attribute Summary collapse

Attributes inherited from HtmlElem

#array, #attrs, #children, #data, #name, #tag

Instance Method Summary collapse

Methods inherited from HtmlElem

#append, #extract, #find, #has?, #inspect, #print, #readlink, #search

Constructor Details

#initialize(ah) ⇒ Image

Returns a new instance of Image.



15
16
17
18
19
20
21
22
# File 'lib/webunit/image.rb', line 15

def initialize( ah )
  super( 'img', ah )
  @src = ah["src"]
  @alt = ah["alt"]
  @width = ah["width"]
  @height = ah["height"]
  @border = ah["border"]
end

Instance Attribute Details

#altObject (readonly)

Returns the value of attribute alt.



13
14
15
# File 'lib/webunit/image.rb', line 13

def alt
  @alt
end

#borderObject (readonly)

Returns the value of attribute border.



13
14
15
# File 'lib/webunit/image.rb', line 13

def border
  @border
end

#heightObject (readonly)

Returns the value of attribute height.



13
14
15
# File 'lib/webunit/image.rb', line 13

def height
  @height
end

#srcObject (readonly)

Returns the value of attribute src.



13
14
15
# File 'lib/webunit/image.rb', line 13

def src
  @src
end

#widthObject (readonly)

Returns the value of attribute width.



13
14
15
# File 'lib/webunit/image.rb', line 13

def width
  @width
end