Class: SVG::Anchor
- Inherits:
-
ElementBase
- Object
- ElementBase
- SVG::Anchor
- Includes:
- ArrayMixin
- Defined in:
- lib/ruby-svg/element.rb
Overview
#
Anchor Class
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#uri ⇒ Object
Returns the value of attribute uri.
Attributes inherited from ElementBase
#attr, #class, #id, #style, #transform
Instance Method Summary collapse
-
#initialize(uri) ⇒ Anchor
constructor
A new instance of Anchor.
- #to_s ⇒ Object
Methods included from ArrayMixin
#<<, #[], #[]=, #clear, #each, #first, #last
Constructor Details
#initialize(uri) ⇒ Anchor
Returns a new instance of Anchor.
75 76 77 78 79 |
# File 'lib/ruby-svg/element.rb', line 75 def initialize(uri) super() @uri = uri @elements = [] end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
82 83 84 |
# File 'lib/ruby-svg/element.rb', line 82 def elements @elements end |
#uri ⇒ Object
Returns the value of attribute uri.
81 82 83 |
# File 'lib/ruby-svg/element.rb', line 81 def uri @uri end |
Instance Method Details
#to_s ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/ruby-svg/element.rb', line 89 def to_s text = %|<a| text << super() text << %| xlink:href="#{@uri}">\n| text << @elements.collect { |element| element.to_s + "\n" }.join text << %|</a>\n| end |