Class: Computering::Dsl::Link

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

Instance Attribute Summary

Attributes inherited from Text

#text

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Text

#[], #blank?, #buffer, #padding

Constructor Details

#initialize(text, link) ⇒ Link

Returns a new instance of Link.



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

def initialize(text, link)
  super text
  @link = link
end

Class Method Details

.from_text(text, link) ⇒ Object



4
5
6
# File 'lib/computering/dsl/link.rb', line 4

def self.from_text(text, link)
  Array(self.new text, link)
end

Instance Method Details

#executeObject



13
14
15
16
17
# File 'lib/computering/dsl/link.rb', line 13

def execute
  `#{command_by_os} '#{@link}'`
rescue
  @buffer = add_style($!.message, :error)
end