Class: SVG::Use

Inherits:
ElementBase show all
Defined in:
lib/ruby-svg/element.rb

Overview

#

Use Class

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#attr, #class, #id, #style, #transform

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Use

Returns a new instance of Use.



103
104
105
106
# File 'lib/ruby-svg/element.rb', line 103

def initialize(uri)
  super()
  @uri      = uri
end

Instance Attribute Details

#uriObject

Returns the value of attribute uri.



108
109
110
# File 'lib/ruby-svg/element.rb', line 108

def uri
  @uri
end

Instance Method Details

#to_sObject



110
111
112
113
114
# File 'lib/ruby-svg/element.rb', line 110

def to_s
 text = %|<use|
 text << super()
 text << %| xlink:href="#{@uri}"/>\n|
end