Method: OpenAI::Internal::Util.coerce_boolean

Defined in:
lib/openai/internal/util.rb

.coerce_boolean(input) ⇒ Boolean, Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Returns:



91
92
93
94
95
96
97
98
99
100
# File 'lib/openai/internal/util.rb', line 91

def coerce_boolean(input)
  case input.is_a?(String) ? input.downcase : input
  in "true"
    true
  in "false"
    false
  else
    input
  end
end