Class: ConvertApi::FormatDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/convert_api/format_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ FormatDetector

Returns a new instance of FormatDetector.



3
4
5
# File 'lib/convert_api/format_detector.rb', line 3

def initialize(resource)
  @resource = resource
end

Instance Method Details

#runObject



7
8
9
10
11
# File 'lib/convert_api/format_detector.rb', line 7

def run
  return @resource.file_ext.downcase if @resource.is_a?(UploadIO)

  format_from_path
end