Class: Svg::Circle
Instance Attribute Summary collapse
-
#center_x ⇒ Object
Returns the value of attribute center_x.
-
#center_y ⇒ Object
Returns the value of attribute center_y.
-
#radius ⇒ Object
Returns the value of attribute radius.
Attributes inherited from Feature
#fill, #fill_opacity, #stroke, #stroke_opacity, #stroke_width, #style
Instance Method Summary collapse
Methods inherited from Feature
Instance Attribute Details
#center_x ⇒ Object
Returns the value of attribute center_x.
61 62 63 |
# File 'lib/svg.rb', line 61 def center_x @center_x end |
#center_y ⇒ Object
Returns the value of attribute center_y.
61 62 63 |
# File 'lib/svg.rb', line 61 def center_y @center_y end |
#radius ⇒ Object
Returns the value of attribute radius.
61 62 63 |
# File 'lib/svg.rb', line 61 def radius @radius end |
Instance Method Details
#to_svg ⇒ Object
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 |