Class: Svg::Circle

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.



61
62
63
# File 'lib/svg.rb', line 61

def center_x
  @center_x
end

#center_yObject

Returns the value of attribute center_y.



61
62
63
# File 'lib/svg.rb', line 61

def center_y
  @center_y
end

#radiusObject

Returns the value of attribute radius.



61
62
63
# File 'lib/svg.rb', line 61

def radius
  @radius
end

Instance Method Details

#to_svgObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/svg.rb', line 62

def to_svg
  "<circle cx=\"#{center_x}\" cy=\"#{center_y}\" r=\"#{radius}\" stroke=\"#{stroke}\" stroke-width=\"#{stroke_width}\" fill=\"#{fill}\" />"
  string_val = "<circle"
  string_val += attr_to_s 'cx', center_x
  string_val += attr_to_s 'cy', center_y
  string_val += attr_to_s 'r', radius
  string_val += attr_to_s 'stroke', stroke
  string_val += attr_to_s 'stroke-width', stroke_width
  string_val += attr_to_s 'fill', fill
  if not style.nil?
    string_val += " style=\"#{style.to_s}\""
  end
  string_val += "/>"

  return string_val
end