Sha256: 6c5b934a2e730ff37f6bf872f79cb0ee103f67a8096213c4d6c48374aed27ea2

Contents?: true

Size: 330 Bytes

Versions: 17

Compression:

Stored size: 330 Bytes

Contents

# frozen_string_literal: true

if Lite::Ruby.configuration.monkey_patches.include?('boolean')
  class FalseClass

    def to_bool
      self
    end

    alias to_b to_bool

    def to_i
      0
    end

  end

  class TrueClass

    def to_bool
      self
    end

    alias to_b to_bool

    def to_i
      1
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
lite-ruby-1.0.31 lib/lite/ruby/boolean.rb
lite-ruby-1.0.30 lib/lite/ruby/boolean.rb
lite-ruby-1.0.29 lib/lite/ruby/boolean.rb
lite-ruby-1.0.28 lib/lite/ruby/boolean.rb
lite-ruby-1.0.27 lib/lite/ruby/boolean.rb
lite-ruby-1.0.26 lib/lite/ruby/boolean.rb
lite-ruby-1.0.25 lib/lite/ruby/boolean.rb
lite-ruby-1.0.24 lib/lite/ruby/boolean.rb
lite-ruby-1.0.23 lib/lite/ruby/boolean.rb
lite-ruby-1.0.22 lib/lite/ruby/boolean.rb
lite-ruby-1.0.21 lib/lite/ruby/boolean.rb
lite-ruby-1.0.20 lib/lite/ruby/boolean.rb
lite-ruby-1.0.19 lib/lite/ruby/boolean.rb
lite-ruby-1.0.18 lib/lite/ruby/boolean.rb
lite-ruby-1.0.17 lib/lite/ruby/boolean.rb
lite-ruby-1.0.16 lib/lite/ruby/boolean.rb
lite-ruby-1.0.15 lib/lite/ruby/boolean.rb