Module: Sheetah::Backends

Defined in:
lib/sheetah/backends.rb,
lib/sheetah/backends/csv.rb,
lib/sheetah/backends/xlsx.rb,
lib/sheetah/backends/wrapper.rb

Defined Under Namespace

Classes: Csv, Wrapper, Xlsx

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.registryObject (readonly)

Returns the value of attribute registry.



14
15
16
# File 'lib/sheetah/backends.rb', line 14

def registry
  @registry
end

Class Method Details

.open(*args, **opts, &block) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/sheetah/backends.rb', line 16

def open(*args, **opts, &block)
  backend = opts.delete(:backend) || registry.get(*args, **opts)

  if backend.nil?
    return Utils::MonadicResult::Failure.new(SimpleError.new("no_applicable_backend"))
  end

  backend.open(*args, **opts, &block)
end