Class: Computering::Dsl::Link
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(text, link) ⇒ Link
constructor
A new instance of Link.
Methods inherited from Text
Constructor Details
#initialize(text, link) ⇒ Link
Returns a new instance of Link.
3 4 5 6 7 |
# File 'lib/computering/dsl/link.rb', line 3 def initialize(text, link) @text = " #{'☞'.color(:green)} #{text}" @link = link @buffer = '' end |
Class Method Details
.from_text(text, link) ⇒ Object
15 16 17 |
# File 'lib/computering/dsl/link.rb', line 15 def self.from_text(text, link) Array(self.new text, link) end |
Instance Method Details
#execute ⇒ Object
9 10 11 12 13 |
# File 'lib/computering/dsl/link.rb', line 9 def execute `open '#{@link}'` rescue puts $! end |