Method: ATypes::BooleanWrap.try_convert

Defined in:
lib/a_types/decorators/boolean_wrap.rb

.try_convert(source) ⇒ true, ...

Will try to convert given object to a boolean value according to #to_bool!. If this fails, it will return nil.

Parameters:

  • source (Object)

    to be converted to a boolean value.

Returns:

  • (true, false, nil)

    depending on whether and how the object is convertible



153
154
155
# File 'lib/a_types/decorators/boolean_wrap.rb', line 153

def self.try_convert(source)
  new(source).to_bool!
end