Module: Flak::Errors
- Defined in:
- lib/flak/rake/errors.rb
Overview
Module that contains flak error functions
Class Method Summary collapse
-
.assert(var, type, bind, file) ⇒ String
Assert that a variable exists and has the correct type.
Class Method Details
.assert(var, type, bind, file) ⇒ String
Assert that a variable exists and has the correct type. Prints a bright red informative message if not.
17 18 19 20 |
# File 'lib/flak/rake/errors.rb', line 17 def self.assert(var, type, bind, file) param = eval(var,bind) ap "#{var} is not a #{type}. It is a #{param.class}. (#{File.basename(file)})" , :color => {:string => :red} unless param.class == Kernel.const_get(type) end |