Class: Treat::Workers::Processors::Chunkers::Autoselect

Inherits:
Object
  • Object
show all
Defined in:
lib/treat/workers/processors/chunkers/autoselect.rb

Class Method Summary collapse

Class Method Details

.chunk(entity, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/treat/workers/processors/chunkers/autoselect.rb', line 3

def self.chunk(entity, options = {})
  unless entity.has?(:format)
    entity.set :format, 'txt'
  end
  begin
    k = Treat::Workers::Processors::Chunkers.const_get(entity.format.cc)
    k.chunk(entity, options)
  rescue Treat::Exception
    Treat::Workers::Processors::Chunkers::TXT.chunk(entity, options)
  end
  
end