Module: ToBoolean

Included in:
FalseClass, NilClass, Numeric, String, TrueClass
Defined in:
lib/message_media_lookups/api_helper.rb

Overview

Extend types to support to_bool.

Instance Method Summary collapse

Instance Method Details

#to_boolObject



244
245
246
247
# File 'lib/message_media_lookups/api_helper.rb', line 244

def to_bool
  return true if self == true || to_s.strip =~ /^(true|yes|y|1)$/i
  false
end