Class: RSVGR::Rect
- Inherits:
-
Object
- Object
- RSVGR::Rect
- Defined in:
- lib/rsvgr.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Rect
constructor
A new instance of Rect.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Rect
Returns a new instance of Rect.
90 91 92 93 94 95 96 |
# File 'lib/rsvgr.rb', line 90 def initialize *args @x = 0 @y = 0 @width = 1 @height = 1 super end |
Instance Method Details
#to_s ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/rsvgr.rb', line 97 def to_s "<rect" + " x=\"#{DEFAULT_SIZE * @x}\"" + " y=\"#{DEFAULT_SIZE * @y}\"" + " width=\"#{DEFAULT_SIZE * @width}\"" + " height=\"#{DEFAULT_SIZE * @height}\"" + "#{" stroke=\"#{@stroke_color}\"" if @stroke_color}" + "#{" stroke-width=\"#{@stroke_width}\"" if @stroke_width}" + "#{" fill=\"#{@fill_color}\"" if @fill_color}" + "/>\n" end |