Class: Clarus::Link
- Inherits:
-
Object
- Object
- Clarus::Link
- Defined in:
- lib/clarus/link.rb
Instance Method Summary collapse
-
#initialize(destination, text = nil) ⇒ Link
constructor
A new instance of Link.
- #render ⇒ Object
Constructor Details
#initialize(destination, text = nil) ⇒ Link
Returns a new instance of Link.
3 4 5 6 |
# File 'lib/clarus/link.rb', line 3 def initialize(destination, text = nil) @destination = destination @text = text || destination end |
Instance Method Details
#render ⇒ Object
8 9 10 11 |
# File 'lib/clarus/link.rb', line 8 def render document_template = File.read(File.('../templates/link_template.erb', __FILE__)) Erubis::Eruby.new(document_template).result(:text => @text, :destination => @destination) end |