summaryrefslogtreecommitdiff
path: root/lib/scale/shapes/rectangle.rb
blob: fb5b44e3ae7ea59fd88fd3abae5c4d1145854765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'virtus'

module Scale
  class Rectangle
    include Node
    include Virtus.model
    attribute :width, String
    attribute :height, String
    attribute :fill, String
    attribute :x, Integer
    attribute :y, Integer
    attribute :rx, Integer
    attribute :ry, Integer

    def xml_tag
      :rect
    end

    def attributes
      super.delete_if { |key, value| value.nil? }
    end
  end
end