Class: Emfsvg::Svg::Elements::Ellipse

Inherits:
Emfsvg::Svg::Element show all
Defined in:
lib/emfsvg/svg/elements/ellipse.rb

Overview

Constant Summary collapse

ELEMENT_NAME =
"ellipse"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_pathObject (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

#cxObject (readonly)

Returns the value of attribute cx.



11
12
13
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11

def cx
  @cx
end

#cyObject (readonly)

Returns the value of attribute cy.



11
12
13
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11

def cy
  @cy
end

#fillObject (readonly)

Returns the value of attribute fill.



11
12
13
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11

def fill
  @fill
end

#rxObject (readonly)

Returns the value of attribute rx.



11
12
13
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11

def rx
  @rx
end

#ryObject (readonly)

Returns the value of attribute ry.



11
12
13
# File 'lib/emfsvg/svg/elements/ellipse.rb', line 11

def ry
  @ry
end

#strokeObject (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