Class: PageBuilder::Elements::Anchor
- Defined in:
- lib/pagebuilder/elements/anchor.rb
Overview
Creates anchor nodes and adds some helper methods for commonly used attributes
Class Method Summary collapse
-
.new(parent_or_doc) ⇒ Object
We have to override #new because nokogiri creates the nodes before calling initialize.
Instance Method Summary collapse
-
#href ⇒ String?
Gets the current href attribute’s value.
-
#href=(url) ⇒ Object
Sets the href attribute’s value.
Methods inherited from Basic
Class Method Details
.new(parent_or_doc) ⇒ Object
We have to override #new because nokogiri creates the nodes before calling initialize
13 14 15 |
# File 'lib/pagebuilder/elements/anchor.rb', line 13 def self.new(parent_or_doc) super('a', parent_or_doc) end |
Instance Method Details
#href ⇒ String?
Gets the current href attribute’s value
19 20 21 |
# File 'lib/pagebuilder/elements/anchor.rb', line 19 def href self['href'] end |
#href=(url) ⇒ Object
Sets the href attribute’s value
26 27 28 |
# File 'lib/pagebuilder/elements/anchor.rb', line 26 def href=(url) self['href'] = url end |