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

Instance Attribute Details

#center_xObject

Returns the value of attribute center_x.



102
103
104
# File 'lib/svg.rb', line 102

def center_x
  @center_x
end

#center_yObject

Returns the value of attribute center_y.



102
103
104
# File 'lib/svg.rb', line 102

def center_y
  @center_y
end

#radius_xObject

Returns the value of attribute radius_x.



102
103
104
# File 'lib/svg.rb', line 102

def radius_x
  @radius_x
end

#radius_yObject

Returns the value of attribute radius_y.



102
103
104
# File 'lib/svg.rb', line 102

def radius_y
  @radius_y
end

Instance Method Details

#to_svgObject



103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/svg.rb', line 103

def to_svg
  string_val = "<ellipse"
  string_val += attr_to_s 'cx', center_x
  string_val += attr_to_s 'cy', center_y
  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