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, #point_to_s

Instance Attribute Details

#centerObject

Returns the value of attribute center.



67
68
69
# File 'lib/svg.rb', line 67

def center
  @center
end

#radiusObject

Returns the value of attribute radius.



67
68
69
# File 'lib/svg.rb', line 67

def radius
  @radius
end

Instance Method Details

#to_svgObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/svg.rb', line 68

def to_svg
  string_val = "<circle"

  string_val += point_to_s 'cx', 'cy', center

  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