Class: SVG::Circle

Inherits:
ElementBase show all
Defined in:
lib/ruby-svg/element.rb

Overview

#

Circle Class

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#attr, #class, #id, #style, #transform

Instance Method Summary collapse

Constructor Details

#initialize(cx, cy, r) ⇒ Circle

Returns a new instance of Circle.



152
153
154
155
156
157
158
# File 'lib/ruby-svg/element.rb', line 152

def initialize(cx, cy, r)
  super()

  @cx = cx
  @cy = cy
  @r  = r
end

Instance Attribute Details

#cxObject

Returns the value of attribute cx.



160
161
162
# File 'lib/ruby-svg/element.rb', line 160

def cx
  @cx
end

#cyObject

Returns the value of attribute cy.



160
161
162
# File 'lib/ruby-svg/element.rb', line 160

def cy
  @cy
end

#rObject

Returns the value of attribute r.



160
161
162
# File 'lib/ruby-svg/element.rb', line 160

def r
  @r
end

Instance Method Details

#to_sObject



162
163
164
165
166
167
# File 'lib/ruby-svg/element.rb', line 162

def to_s
  text = %|<circle cx="#{@cx}" cy="#{@cy}" r="#{@r}"|
  text << super()
  text << %| />|
  return text
end