Method: Cuboid::Application#safe

Defined in:
lib/cuboid/application.rb

#safe(&block) ⇒ Object

Raises:

  • (ArgumentError)


312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/cuboid/application.rb', line 312

def safe( &block )
    raise ArgumentError, 'Missing block.' if !block_given?

    begin
        block.call self
    ensure
        clean_up
        reset
    end

    nil
end