Class: Svg::Rectangle
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#top_x ⇒ Object
Returns the value of attribute top_x.
-
#top_y ⇒ Object
Returns the value of attribute top_y.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from Feature
#fill, #fill_opacity, #stroke, #stroke_opacity, #stroke_width, #style
Instance Method Summary collapse
Methods inherited from Feature
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
81 82 83 |
# File 'lib/svg.rb', line 81 def height @height end |
#top_x ⇒ Object
Returns the value of attribute top_x.
81 82 83 |
# File 'lib/svg.rb', line 81 def top_x @top_x end |
#top_y ⇒ Object
Returns the value of attribute top_y.
81 82 83 |
# File 'lib/svg.rb', line 81 def top_y @top_y end |
#width ⇒ Object
Returns the value of attribute width.
81 82 83 |
# File 'lib/svg.rb', line 81 def width @width end |
Instance Method Details
#to_svg ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/svg.rb', line 82 def to_svg string_val = "<rect" string_val += attr_to_s 'x', top_x string_val += attr_to_s 'y', top_y string_val += attr_to_s 'width', width string_val += attr_to_s 'height', height if not style.nil? string_val += " style=\"#{style.to_s}\"" end string_val += "/>" return string_val end |