Class: SVG::Ellipse

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

Overview

#

Ellipse Class

Instance Attribute Summary collapse

Attributes inherited from ElementBase

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

Instance Method Summary collapse

Constructor Details

#initialize(cx, cy, rx, ry) ⇒ Ellipse

Returns a new instance of Ellipse.



175
176
177
178
179
180
181
182
# File 'lib/ruby-svg/element.rb', line 175

def initialize(cx, cy, rx, ry)
  super()

  @cx = cx
  @cy = cy
  @rx = rx
  @ry = ry
end

Instance Attribute Details

#cxObject

Returns the value of attribute cx.



184
185
186
# File 'lib/ruby-svg/element.rb', line 184

def cx
  @cx
end

#cyObject

Returns the value of attribute cy.



184
185
186
# File 'lib/ruby-svg/element.rb', line 184

def cy
  @cy
end

#rxObject

Returns the value of attribute rx.



184
185
186
# File 'lib/ruby-svg/element.rb', line 184

def rx
  @rx
end

#ryObject

Returns the value of attribute ry.



184
185
186
# File 'lib/ruby-svg/element.rb', line 184

def ry
  @ry
end

Instance Method Details

#to_sObject



186
187
188
189
190
191
# File 'lib/ruby-svg/element.rb', line 186

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