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