Class: Bio::Graphics::ImageMap::Element
- Inherits:
-
Object
- Object
- Bio::Graphics::ImageMap::Element
- Defined in:
- lib/bio/graphics/image_map.rb
Instance Attribute Summary collapse
-
#bottom ⇒ Object
Returns the value of attribute bottom.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#top ⇒ Object
Returns the value of attribute top.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(left, top, right, bottom, url = nil) ⇒ Element
constructor
A new instance of Element.
- #to_s ⇒ Object
Constructor Details
#initialize(left, top, right, bottom, url = nil) ⇒ Element
Returns a new instance of Element.
44 45 46 47 |
# File 'lib/bio/graphics/image_map.rb', line 44 def initialize(left, top, right, bottom, url = nil) @left, @top, @right, @bottom = left, top, right, bottom @url = ( url.nil? ) ? '' : url end |
Instance Attribute Details
#bottom ⇒ Object
Returns the value of attribute bottom.
48 49 50 |
# File 'lib/bio/graphics/image_map.rb', line 48 def bottom @bottom end |
#left ⇒ Object
Returns the value of attribute left.
48 49 50 |
# File 'lib/bio/graphics/image_map.rb', line 48 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
48 49 50 |
# File 'lib/bio/graphics/image_map.rb', line 48 def right @right end |
#top ⇒ Object
Returns the value of attribute top.
48 49 50 |
# File 'lib/bio/graphics/image_map.rb', line 48 def top @top end |
#url ⇒ Object
Returns the value of attribute url.
48 49 50 |
# File 'lib/bio/graphics/image_map.rb', line 48 def url @url end |
Instance Method Details
#to_s ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/bio/graphics/image_map.rb', line 50 def to_s if @url == '' return '' else return '<area shape="rect" coords="' + @left.to_s + ' ' + @top.to_s + ' ' + @right.to_s + ' ' + @bottom.to_s + '" href="' + @url + '"/>' end end |