lib/puppet_x/coi/jboss/functions/to_bool.rb
# PRIVATE INTERNAL FUNCTION. Casts any value to boolean
#
# @param args [Array] should be only one argument in array
# @return [string] casted value to boolean
PRIVATE INTERNAL FUNCTION. Casts any value to boolean
PRIVATE INTERNAL FUNCTION . Casts any value to boolean
def to_bool(args)
      validate_method_parameters('jboss_to_bool', args) do
        { :desc => '1', :condition => args.size != 1 }
      end
      string = args[0]
      return string if !(!string) == string
      string = string.to_s if string.is_a?(Symbol)
      string = string.inspect unless string.is_a?(String)
      to_bool_cases(string)
    end
def to_bool ( args ) validate_method_parameters ( 'jboss_to_bool' , args ) do { :desc => '1' , :condition => args . size != 1 } end string = args [ 0 ] return string if ! ( ! string ) == string string = string . to_s if string . is_a? ( Symbol ) string = string . inspect unless string . is_a? ( String ) to_bool_cases ( string ) end
PRIVATE INTERNAL FUNCTION.
PRIVATE INTERNAL FUNCTION .
# If string is already Boolean, return it # We consider all the yes, no, y, n and so on too ...
casted value to boolean
casted value to boolean
string
args
should be only one argument in array
should be only one argument in array