class MovieMasher::Destination

A Transfer object used as Job#destination or Output#destination representing a remote host ready to accept rendered file(s).

Destination.create {
  type: Type::HTTP,
  host: 'example.com', # http://example.com/cgi-bin/error.cgi?i=123
  path: 'cgi-bin/upload.cgi',
  parameters: {i: '{job.id}'}  # Scalar - Job#id
}

Public Class Methods

create(hash = nil) click to toggle source

Returns

Returns a new instance.

# File lib/destination.rb, line 17
def create(hash = nil)
  (hash.is_a?(Destination) ? hash : new(hash))
end
create_if(hash) click to toggle source
# File lib/destination.rb, line 21
def create_if(hash)
  (hash ? create(hash) : nil)
end
init_hash(hash) click to toggle source
# File lib/destination.rb, line 25
def init_hash(hash)
  Transfer.init_hash(hash)
end

Public Instance Methods

__service() click to toggle source
# File lib/destination.rb, line 45
def __service
  service = Service.uploader(type)
  raise(Error::Configuration, "no #{type} upload service") unless service

  service
end
directory_files(file) click to toggle source
# File lib/destination.rb, line 41
def directory_files(file)
  __service.directory_files(file)
end
error?() click to toggle source
# File lib/destination.rb, line 30
def error?
  return unless name.to_s.include?('/')

  "destination name contains slash - use path instead #{name}"
end
upload(options) click to toggle source
# File lib/destination.rb, line 36
def upload(options)
  options[:destination] = self
  __service.upload(options)
end