Class: SVG::Line
- Inherits:
-
ElementBase
- Object
- ElementBase
- SVG::Line
- Defined in:
- lib/ruby-svg/element.rb
Overview
#
Line Class
Instance Attribute Summary collapse
-
#x1 ⇒ Object
Returns the value of attribute x1.
-
#x2 ⇒ Object
Returns the value of attribute x2.
-
#y1 ⇒ Object
Returns the value of attribute y1.
-
#y2 ⇒ Object
Returns the value of attribute y2.
Attributes inherited from ElementBase
#attr, #class, #id, #style, #transform
Instance Method Summary collapse
-
#initialize(x1, y1, x2, y2) ⇒ Line
constructor
A new instance of Line.
- #to_s ⇒ Object
Constructor Details
#initialize(x1, y1, x2, y2) ⇒ Line
Returns a new instance of Line.
199 200 201 202 203 204 205 |
# File 'lib/ruby-svg/element.rb', line 199 def initialize(x1, y1, x2, y2) super() @x1 = x1 @y1 = y1 @x2 = x2 @y2 = y2 end |
Instance Attribute Details
#x1 ⇒ Object
Returns the value of attribute x1.
207 208 209 |
# File 'lib/ruby-svg/element.rb', line 207 def x1 @x1 end |
#x2 ⇒ Object
Returns the value of attribute x2.
207 208 209 |
# File 'lib/ruby-svg/element.rb', line 207 def x2 @x2 end |
#y1 ⇒ Object
Returns the value of attribute y1.
207 208 209 |
# File 'lib/ruby-svg/element.rb', line 207 def y1 @y1 end |
#y2 ⇒ Object
Returns the value of attribute y2.
207 208 209 |
# File 'lib/ruby-svg/element.rb', line 207 def y2 @y2 end |
Instance Method Details
#to_s ⇒ Object
209 210 211 212 213 214 |
# File 'lib/ruby-svg/element.rb', line 209 def to_s text = %|<line x1="#{@x1}" y1="#{@y1}" x2="#{@x2}" y2="#{@y2}"| text << super() text << %| />| return text end |