Class: Gretel::Link
- Inherits:
-
Object
- Object
- Gretel::Link
- Defined in:
- lib/gretel/link.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#text ⇒ Object
Returns the value of attribute text.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #current! ⇒ Object
- #current? ⇒ Boolean
-
#initialize(key, text, url) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(key, text, url) ⇒ Link
Returns a new instance of Link.
5 6 7 8 |
# File 'lib/gretel/link.rb', line 5 def initialize(key, text, url) # Use accessors so plugins can override their behavior self.key, self.text, self.url = key, text, url end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/gretel/link.rb', line 3 def key @key end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/gretel/link.rb', line 3 def text @text end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/gretel/link.rb', line 3 def url @url end |
Instance Method Details
#current! ⇒ Object
10 11 12 |
# File 'lib/gretel/link.rb', line 10 def current! @current = true end |
#current? ⇒ Boolean
14 15 16 |
# File 'lib/gretel/link.rb', line 14 def current? !!@current end |