Sha256: 3dac59b139979635fda83b50620d937eb63ad0e8ab0a7cc32625a77358d8ac6e

Contents?: true

Size: 367 Bytes

Versions: 1

Compression:

Stored size: 367 Bytes

Contents

# encoding: utf-8

# Object
class Object
  # you get bool value
  #
  #   true.to_bool # => true
  #   false.to_bool # => false
  #   0.to_bool # => true
  #   1.to_bool # => true
  #   ''.to_bool # => true
  #   'true'.to_bool # => true
  #   'false'.to_bool # => true
  #   nil.to_bool # => false
  def to_bool
    !!self # rubocop:disable DoubleNegation
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.151 lib/open_classes/object/to_bool.rb