Class: Columbus::Link
- Inherits:
-
Struct
- Object
- Struct
- Columbus::Link
- Defined in:
- lib/columbus/link.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
Returns the value of attribute href.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#href ⇒ Object
Returns the value of attribute href
2 3 4 |
# File 'lib/columbus/link.rb', line 2 def href @href end |
#title ⇒ Object
Returns the value of attribute title
2 3 4 |
# File 'lib/columbus/link.rb', line 2 def title @title end |
#url ⇒ Object
Returns the value of attribute url
2 3 4 |
# File 'lib/columbus/link.rb', line 2 def url @url end |
Instance Method Details
#absolute_url ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/columbus/link.rb', line 7 def absolute_url if relative? "#{url}#{href}" else "#{href}" end end |
#clean_title ⇒ Object
3 4 5 |
# File 'lib/columbus/link.rb', line 3 def clean_title title.nil? ? nil : title.strip end |
#relative? ⇒ Boolean
15 16 17 |
# File 'lib/columbus/link.rb', line 15 def relative? href =~ /^\// end |