class ABBYY::Cloud::Operations::File

Public Instance Methods

path() click to toggle source
# File lib/abbyy/cloud/operations/file.rb, line 13
def path
  @path ||= \
    if source.respond_to?(:path)
      Pathname.new(source.path).basename
    else
      "#{SecureRandom.hex(4)}.#{ext}"
    end
end
read() click to toggle source
# File lib/abbyy/cloud/operations/file.rb, line 9
def read
  source.respond_to?(:read) ? source.read : source
end

Private Instance Methods

ext() click to toggle source
# File lib/abbyy/cloud/operations/file.rb, line 24
def ext
  MIME::Types[content_type].first.preferred_extension
end