Sha256: 5fafee4b44863104d39aa1f62c13b9ee478e42ce084a17be81c18f7c35b94a27

Contents?: true

Size: 332 Bytes

Versions: 111

Compression:

Stored size: 332 Bytes

Contents

# encoding: utf-8

# Object
class Object
  # Check boolean type
  #
  #   boolean? true # => true
  #   boolean? false # => true
  #   boolean? nil # => false
  #   boolean? 'true' # => false
  #   boolean? 'false' # => false
  #   boolean? '' # => false
  def boolean?
    self.is_a?(TrueClass) || self.is_a?(FalseClass)
  end
end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
tbpgr_utils-0.0.131 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.130 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.129 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.128 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.127 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.126 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.125 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.124 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.123 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.122 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.121 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.120 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.119 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.118 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.117 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.116 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.115 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.114 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.113 lib/open_classes/object/boolean.rb
tbpgr_utils-0.0.112 lib/open_classes/object/boolean.rb