Class: WebUnit::Image
Instance Attribute Summary collapse
-
#alt ⇒ Object
readonly
Returns the value of attribute alt.
-
#border ⇒ Object
readonly
Returns the value of attribute border.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from HtmlElem
#array, #attrs, #children, #data, #name, #tag
Instance Method Summary collapse
-
#initialize(ah) ⇒ Image
constructor
A new instance of Image.
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
#alt ⇒ Object (readonly)
Returns the value of attribute alt.
13 14 15 |
# File 'lib/webunit/image.rb', line 13 def alt @alt end |
#border ⇒ Object (readonly)
Returns the value of attribute border.
13 14 15 |
# File 'lib/webunit/image.rb', line 13 def border @border end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
13 14 15 |
# File 'lib/webunit/image.rb', line 13 def height @height end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
13 14 15 |
# File 'lib/webunit/image.rb', line 13 def src @src end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
13 14 15 |
# File 'lib/webunit/image.rb', line 13 def width @width end |