Class: SVG::Path
- Inherits:
-
ElementBase
- Object
- ElementBase
- SVG::Path
- Defined in:
- lib/ruby-svg/element.rb
Overview
#
Path Class
Instance Attribute Summary collapse
-
#length ⇒ Object
Returns the value of attribute length.
-
#path ⇒ Object
Returns the value of attribute path.
Attributes inherited from ElementBase
#attr, #class, #id, #style, #transform
Instance Method Summary collapse
-
#initialize(path, length = nil) ⇒ Path
constructor
A new instance of Path.
- #to_s ⇒ Object
Constructor Details
#initialize(path, length = nil) ⇒ Path
Returns a new instance of Path.
291 292 293 294 295 |
# File 'lib/ruby-svg/element.rb', line 291 def initialize(path, length = nil) super() @path = path @length = length end |
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
297 298 299 |
# File 'lib/ruby-svg/element.rb', line 297 def length @length end |
#path ⇒ Object
Returns the value of attribute path.
297 298 299 |
# File 'lib/ruby-svg/element.rb', line 297 def path @path end |
Instance Method Details
#to_s ⇒ Object
299 300 301 302 303 304 305 |
# File 'lib/ruby-svg/element.rb', line 299 def to_s text = %|<path d="#{@path.join(' ')}"| text = %| length="#{@length}"| if @length text << super() text << %| />| return text end |