class Balmora::Command::Links

Public Instance Methods

_get_command(link) click to toggle source
# File lib/balmora/command/links.rb, line 33
def _get_command(link)
  command = (@options || {}).merge(command: 'link', link: link)

  if link.instance_of?(::Hash)
    command.merge!(link)
  end

  command.merge!(storage: @storage)

  return command
end
init() click to toggle source
Calls superclass method Balmora::Command#init
# File lib/balmora/command/links.rb, line 5
def init()
  super()

  @links = @variables.inject(@links)
  @storage = @variables.inject(@storage)
end
options() click to toggle source
Calls superclass method Balmora::Command#options
# File lib/balmora/command/links.rb, line 12
def options()
  return super().concat([:links, :storage])
end
run() click to toggle source
# File lib/balmora/command/links.rb, line 26
def run()
  @links.each() { |link|
    command = _get_command(link)
    @balmora.run_command(@state, command)
  }
end
verify() click to toggle source
# File lib/balmora/command/links.rb, line 16
def verify()
  if @links.nil?()
    raise Error.new('"links" should be defined')
  end

  if @storage.nil?()
    raise Error.new('"storage" should be defined')
  end
end