Class: SVG::Rect
- Inherits:
-
ElementBase
- Object
- ElementBase
- SVG::Rect
- Defined in:
- lib/ruby-svg/element.rb
Overview
#
Rect Class
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#rx ⇒ Object
Returns the value of attribute rx.
-
#ry ⇒ Object
Returns the value of attribute ry.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Attributes inherited from ElementBase
#attr, #class, #id, #style, #transform
Instance Method Summary collapse
-
#initialize(x, y, width, height, rx = nil, ry = nil) ⇒ Rect
constructor
A new instance of Rect.
- #to_s ⇒ Object
Constructor Details
#initialize(x, y, width, height, rx = nil, ry = nil) ⇒ Rect
Returns a new instance of Rect.
122 123 124 125 126 127 128 129 130 131 |
# File 'lib/ruby-svg/element.rb', line 122 def initialize(x, y, width, height, rx = nil, ry = nil) super() @x = x @y = y @width = width @height = height @rx = rx @ry = ry end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
133 134 135 |
# File 'lib/ruby-svg/element.rb', line 133 def height @height end |
#rx ⇒ Object
Returns the value of attribute rx.
133 134 135 |
# File 'lib/ruby-svg/element.rb', line 133 def rx @rx end |
#ry ⇒ Object
Returns the value of attribute ry.
133 134 135 |
# File 'lib/ruby-svg/element.rb', line 133 def ry @ry end |
#width ⇒ Object
Returns the value of attribute width.
133 134 135 |
# File 'lib/ruby-svg/element.rb', line 133 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
133 134 135 |
# File 'lib/ruby-svg/element.rb', line 133 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
133 134 135 |
# File 'lib/ruby-svg/element.rb', line 133 def y @y end |
Instance Method Details
#to_s ⇒ Object
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/ruby-svg/element.rb', line 135 def to_s text = %|<rect width="#{@width}" height="#{@height}"| text << %| x="#{@x}"| if @x text << %| y="#{@y}"| if @y text << %| rx="#{@rx}"| if @rx text << %| ry="#{@ry}"| if @ry text << super() text << %| />| return text end |