Class: Emfsvg::Svg::Elements::Ellipse
- Inherits:
-
Emfsvg::Svg::Element
- Object
- Emfsvg::Svg::Element
- Emfsvg::Svg::Elements::Ellipse
- Defined in:
- lib/emfsvg/svg/elements/ellipse.rb
Overview
Constant Summary collapse
- ELEMENT_NAME =
"ellipse"
Instance Attribute Summary collapse
-
#clip_path ⇒ Object
readonly
Returns the value of attribute clip_path.
-
#cx ⇒ Object
readonly
Returns the value of attribute cx.
-
#cy ⇒ Object
readonly
Returns the value of attribute cy.
-
#fill ⇒ Object
readonly
Returns the value of attribute fill.
-
#rx ⇒ Object
readonly
Returns the value of attribute rx.
-
#ry ⇒ Object
readonly
Returns the value of attribute ry.
-
#stroke ⇒ Object
readonly
Returns the value of attribute stroke.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cx:, cy:, rx:, ry:, fill:, stroke:, clip_path: nil) ⇒ Ellipse
constructor
A new instance of Ellipse.
Methods inherited from Emfsvg::Svg::Element
#children, #element_name, register
Constructor Details
#initialize(cx:, cy:, rx:, ry:, fill:, stroke:, clip_path: nil) ⇒ Ellipse
Returns a new instance of Ellipse.
13 14 15 16 17 18 19 20 21 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 13 def initialize(cx:, cy:, rx:, ry:, fill:, stroke:, clip_path: nil) @cx = cx @cy = cy @rx = rx @ry = ry @fill = fill @stroke = stroke @clip_path = clip_path end |
Instance Attribute Details
#clip_path ⇒ Object (readonly)
Returns the value of attribute clip_path.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def clip_path @clip_path end |
#cx ⇒ Object (readonly)
Returns the value of attribute cx.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def cx @cx end |
#cy ⇒ Object (readonly)
Returns the value of attribute cy.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def cy @cy end |
#fill ⇒ Object (readonly)
Returns the value of attribute fill.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def fill @fill end |
#rx ⇒ Object (readonly)
Returns the value of attribute rx.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def rx @rx end |
#ry ⇒ Object (readonly)
Returns the value of attribute ry.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def ry @ry end |
#stroke ⇒ Object (readonly)
Returns the value of attribute stroke.
11 12 13 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11 def stroke @stroke end |
Class Method Details
.from_node(node) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 23 def self.from_node(node) new( cx: AttributeParser.float(node["cx"]), cy: AttributeParser.float(node["cy"]), rx: AttributeParser.float(node["rx"]), ry: AttributeParser.float(node["ry"]), **Stylable.parse_style(node) ) end |