Class: Gretel::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/gretel/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/gretel/link.rb', line 3

def key
  @key
end

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/gretel/link.rb', line 3

def text
  @text
end

#urlObject

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

Returns:

  • (Boolean)


14
15
16
# File 'lib/gretel/link.rb', line 14

def current?
  !!@current
end