Class: AsyncBlock::SourceToBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/async_block/block_source_service.rb

Overview

SourceToBlock - converts source string to code block this will help in preventing writing of new jobs to run smaller pieces of code

The following full app-like example demonstrates how to use the SourceToBlock

block = BlockToSource.new(block_string).convert block&.call

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ SourceToBlock

Returns a new instance of SourceToBlock.



37
38
39
# File 'lib/async_block/block_source_service.rb', line 37

def initialize(source)
  @source = source
end

Instance Method Details

#convertObject



41
42
43
# File 'lib/async_block/block_source_service.rb', line 41

def convert
  source_to_block
end