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

Instance Attribute Details

#heightObject

Returns the value of attribute height.



81
82
83
# File 'lib/svg.rb', line 81

def height
  @height
end

#top_xObject

Returns the value of attribute top_x.



81
82
83
# File 'lib/svg.rb', line 81

def top_x
  @top_x
end

#top_yObject

Returns the value of attribute top_y.



81
82
83
# File 'lib/svg.rb', line 81

def top_y
  @top_y
end

#widthObject

Returns the value of attribute width.



81
82
83
# File 'lib/svg.rb', line 81

def width
  @width
end

Instance Method Details

#to_svgObject



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