Sha256: a530cf7a9ee337ac4222795bfeaa181d5fdddd3e109b55d3a238f34452577edc

Contents?: true

Size: 736 Bytes

Versions: 8

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

module Checkpoint
  class Resource
    # Special class to represent any entity of any type. This is used for
    # zone-/system-wide grants or checks. It is basically so {AllOfAnyType} can
    # have an entity rather than a nil.
    #
    # Wildcards or null objects typically have somewhat strange semantics, and
    # this is no exception. It will compare as eql? and == to any object.
    class AnyEntity
      # Always returns true; this wildcard is "equal" to any object.
      # return [Boolean] true
      def eql?(*)
        true
      end

      # Always returns true; this wildcard is "equal" to any object.
      # return [Boolean] true
      def ==(*)
        true
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
checkpoint-1.1.3 lib/checkpoint/resource/any_entity.rb
checkpoint-1.1.2 lib/checkpoint/resource/any_entity.rb
checkpoint-1.1.1 lib/checkpoint/resource/any_entity.rb
checkpoint-1.1.0 lib/checkpoint/resource/any_entity.rb
checkpoint-1.0.3 lib/checkpoint/resource/any_entity.rb
checkpoint-1.0.2 lib/checkpoint/resource/any_entity.rb
checkpoint-1.0.1 lib/checkpoint/resource/any_entity.rb
checkpoint-1.0.0 lib/checkpoint/resource/any_entity.rb