lib/lorj_meta.rb
# parameters tester functions
#
# * *Args*
#   Each data are defined by a couple parameters.
#   - 1st one is the value to check
#   - 2nd one is the expected class (Class object) or
# acceptable classes (Array of class).
#
# * *Returns*
#   - false if value is not of the expected Class.
#   - true if all parameters are as expected.
#
parameters tester functions
*Args
Each data are defined by a couple parameters.
1st one is the value to check
2nd one is the expected class (Class object) or
acceptable classes (Array of class).

*Returns
false if value is not of the expected Class.
true if all parameters are as expected.
parameters tester functions * Args Each data are defined by a couple parameters . 1st one is the value to check 2nd one is the expected class ( Class object ) or acceptable classes ( Array of class ) . * Returns false if value is not of the expected Class . true if all parameters are as expected .
def check_par(*parameters)
      parameters.each_index do |index|
        next unless index.odd?
        if parameters[index].is_a?(Array)
          unless parameters[index].include?(parameters[index - 1].class)
            return false
          end
        end
        if parameters[index].is_a?(Class)
          return false unless parameters[index - 1].is_a?(parameters[index])
        end
      end
      true
    end
def check_par ( * parameters ) parameters . each_index do | index | next unless index . odd? if parameters [ index ] . is_a? ( Array ) unless parameters [ index ] . include? ( parameters [ index - 1 ] . class ) return false end end if parameters [ index ] . is_a? ( Class ) return false unless parameters [ index - 1 ] . is_a? ( parameters [ index ] ) end end true end
parameters tester functions
 *Args
Each data are defined by a couple parameters.
parameters tester functions * Args Each data are defined by a couple parameters .
parameters
<not_specific>