Class: Svg::Rectangle

Inherits:
Feature show all
Defined in:
lib/svg.rb

Instance Attribute Summary collapse

Attributes inherited from Feature

#fill, #fill_opacity, #stroke, #stroke_opacity, #stroke_width, #style

Instance Method Summary collapse

Methods inherited from Feature

#attr_to_s, #point_to_s

Instance Attribute Details

#heightObject

Returns the value of attribute height.



87
88
89
# File 'lib/svg.rb', line 87

def height
  @height
end

#radius_xObject

Returns the value of attribute radius_x.



87
88
89
# File 'lib/svg.rb', line 87

def radius_x
  @radius_x
end

#radius_yObject

Returns the value of attribute radius_y.



87
88
89
# File 'lib/svg.rb', line 87

def radius_y
  @radius_y
end

#topObject

Returns the value of attribute top.



87
88
89
# File 'lib/svg.rb', line 87

def top
  @top
end

#widthObject

Returns the value of attribute width.



87
88
89
# File 'lib/svg.rb', line 87

def width
  @width
end

Instance Method Details

#to_svgObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/svg.rb', line 88

def to_svg
  string_val = "<rect"

  string_val += point_to_s 'x', 'y', top

  string_val += attr_to_s 'rx', radius_x
  string_val += attr_to_s 'ry', radius_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