Class: Tabulard::TableProcessor

Inherits:
Object
  • Object
show all
Includes:
Utils::MonadicResult
Defined in:
lib/tabulard/table_processor.rb

Constant Summary

Constants included from Utils::MonadicResult

Utils::MonadicResult::Unit

Instance Method Summary collapse

Methods included from Utils::MonadicResult

#Do, #Failure, #Success

Constructor Details

#initialize(specification) ⇒ TableProcessor

Returns a new instance of TableProcessor.



15
16
17
# File 'lib/tabulard/table_processor.rb', line 15

def initialize(specification)
  @specification = specification
end

Instance Method Details

#call(*args, **opts, &block) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/tabulard/table_processor.rb', line 19

def call(*args, **opts, &block)
  messenger = Messaging::Messenger.new

  result = Adapters.open(*args, **opts, messenger: messenger) do |table|
    process(table, messenger, &block)
  end

  handle_result(result, messenger)
end