Class: Svg::Ellipse

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

#centerObject

Returns the value of attribute center.



108
109
110
# File 'lib/svg.rb', line 108

def center
  @center
end

#radius_xObject

Returns the value of attribute radius_x.



108
109
110
# File 'lib/svg.rb', line 108

def radius_x
  @radius_x
end

#radius_yObject

Returns the value of attribute radius_y.



108
109
110
# File 'lib/svg.rb', line 108

def radius_y
  @radius_y
end

Instance Method Details

#to_svgObject



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/svg.rb', line 109

def to_svg
  string_val = "<ellipse"

  if not center.nil?
    string_val += point_to_s 'cx', 'cy', center
  end
  string_val += attr_to_s 'rx', radius_x
  string_val += attr_to_s 'ry', radius_y

  if not style.nil?
    string_val += " style=\"#{style.to_s}\""
  end
  string_val += "/>"

  return string_val
end