Class: Computering::Dsl::Link

Inherits:
Text
  • Object
show all
Defined in:
lib/computering/dsl/link.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Text

#[], #blank?, #buffer

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

#executeObject



9
10
11
12
13
# File 'lib/computering/dsl/link.rb', line 9

def execute
  `open '#{@link}'`
rescue
  puts $!
end