Sha256: d1ff9134c5a11310c54d49d43a961b0499b1b3507b3efcbd864d1b2a949affaf

Contents?: true

Size: 453 Bytes

Versions: 6

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module Kind
  Undefined = Object.new.tap do |undefined|
    def undefined.inspect
      @inspect ||= 'Kind::Undefined'.freeze
    end

    def undefined.to_s
      inspect
    end

    def undefined.clone
      self
    end

    def undefined.dup
      clone
    end

    def undefined.default(value, default)
      return self if value != self

      default.respond_to?(:call) ? default.call : default
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kind-2.1.0 lib/kind/undefined.rb
kind-2.0.0 lib/kind/undefined.rb
kind-1.9.0 lib/kind/undefined.rb
kind-1.8.0 lib/kind/undefined.rb
kind-1.7.0 lib/kind/undefined.rb
kind-1.6.0 lib/kind/undefined.rb