Class: Swordfish::Node::Hyperlink
- Defined in:
- lib/swordfish/nodes/hyperlink.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
Returns the value of attribute href.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#append, #clear_children, #find_nodes_by_type, #inform!, #initialize, #replace, #replace_with, #stylize, #wrap_children
Constructor Details
This class inherits a constructor from Swordfish::Node::Base
Instance Attribute Details
#href ⇒ Object
Returns the value of attribute href.
7 8 9 |
# File 'lib/swordfish/nodes/hyperlink.rb', line 7 def href @href end |
Instance Method Details
#to_html ⇒ Object
9 10 11 12 |
# File 'lib/swordfish/nodes/hyperlink.rb', line 9 def to_html @href ||= "" "<a href=\"#{URI::escape(@href)}\">#{@children.map(&:to_html).join}</a>" end |