Class: ABBYY::Cloud::Operations::File

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer::Mixin
Defined in:
lib/abbyy/cloud/operations/file.rb

Instance Method Summary collapse

Instance Method Details

#pathObject



13
14
15
16
17
18
19
20
# 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

#readObject



9
10
11
# File 'lib/abbyy/cloud/operations/file.rb', line 9

def read
  source.respond_to?(:read) ? source.read : source
end