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