Module: Simplecheck

Defined in:
lib/simplecheck.rb,
lib/simplecheck/version.rb,
lib/simplecheck/check_failed.rb

Defined Under Namespace

Classes: CheckFailed

Constant Summary collapse

VERSION =
'0.9'

Instance Method Summary collapse

Instance Method Details

#check(*arguments, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/simplecheck.rb', line 5

def check( *arguments, &block )
  error_message = if block_given?
                    __check_arguments_with_block( arguments, block )
                  else
                    __check_arguments( arguments )
                  end

  if error_message
    __handle_failure( error_message )
  else
    __handle_return_arguments( arguments )
  end
end