Sha256: f694e191ea783d76ed014e274b52769bf4de4b4732eea4e1b0186581204b7520

Contents?: true

Size: 453 Bytes

Versions: 5

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 self != value

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kind-3.1.0 lib/kind/undefined.rb
kind-3.0.1 lib/kind/undefined.rb
kind-3.0.0 lib/kind/undefined.rb
kind-2.3.0 lib/kind/undefined.rb
kind-2.2.0 lib/kind/undefined.rb