Class: ABBYY::Cloud::Operations::File
- Inherits:
-
Object
- Object
- ABBYY::Cloud::Operations::File
- Extended by:
- Dry::Initializer::Mixin
- Defined in:
- lib/abbyy/cloud/operations/file.rb
Instance Method Summary collapse
Instance Method Details
#path ⇒ Object
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 |
#read ⇒ Object
9 10 11 |
# File 'lib/abbyy/cloud/operations/file.rb', line 9 def read source.respond_to?(:read) ? source.read : source end |