Class: Web::Unit::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.
16 17 18 19 20 21 22 23 |
# File 'lib/web/unit/image.rb', line 16 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.
14 15 16 |
# File 'lib/web/unit/image.rb', line 14 def alt @alt end |
#border ⇒ Object (readonly)
Returns the value of attribute border.
14 15 16 |
# File 'lib/web/unit/image.rb', line 14 def border @border end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
14 15 16 |
# File 'lib/web/unit/image.rb', line 14 def height @height end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
14 15 16 |
# File 'lib/web/unit/image.rb', line 14 def src @src end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
14 15 16 |
# File 'lib/web/unit/image.rb', line 14 def width @width end |