class MovieMasher::Destination

A Transfer object used as MovieMasher::Job#destination or MovieMasher::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 15
def self.create(hash = nil)
  (hash.is_a?(Destination) ? hash : new(hash))
end
create_if(hash) click to toggle source
# File lib/destination.rb, line 18
def self.create_if(hash)
  (hash ? create(hash) : nil)
end
init_hash(hash) click to toggle source
# File lib/destination.rb, line 21
def self.init_hash(hash)
  Transfer.init_hash(hash)
end

Public Instance Methods

__service() click to toggle source
# File lib/destination.rb, line 36
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 33
def directory_files(file)
  __service.directory_files(file)
end
error?() click to toggle source
# File lib/destination.rb, line 24
def error?
  if name.to_s.include?('/')
    "destination name contains slash - use path instead #{name}"
  end
end
upload(options) click to toggle source
# File lib/destination.rb, line 29
def upload(options)
  options[:destination] = self
  __service.upload(options)
end