class Dutchman::GhostWriter::AppleScript::Command

The Command class executes the provided AppleScript.

Attributes

applescript[R]
container[R]

Public Class Methods

new(container,applescript) click to toggle source
# File lib/dutchman/ghost_writer/apple_script/command.rb, line 9
def initialize(container,applescript)
  @container = container
  @applescript = applescript
end

Public Instance Methods

command_line() click to toggle source
# File lib/dutchman/ghost_writer/apple_script/command.rb, line 26
def command_line
  ERB.new(command_line_template).result(binding)
end
command_line_template() click to toggle source
# File lib/dutchman/ghost_writer/apple_script/command.rb, line 30
def command_line_template
  template_with_name "command_line"
end
execute() click to toggle source
# File lib/dutchman/ghost_writer/apple_script/command.rb, line 22
def execute
  container.execute(self)
end
template_with_name(name) click to toggle source
# File lib/dutchman/ghost_writer/apple_script/command.rb, line 34
def template_with_name(name)
  File.read(File.join(File.dirname(__FILE__),"#{name}.erb"))
end
to_s() click to toggle source
# File lib/dutchman/ghost_writer/apple_script/command.rb, line 18
def to_s
  command_line
end