Sha256: fbbdbb63d366b53306d151c6cef0cd3df64fd9eca949ab59030d354a0f4064c7

Contents?: true

Size: 1.05 KB

Versions: 26

Compression:

Stored size: 1.05 KB

Contents

module Foobara
  class Namespace
    # TODO: need to define these better...
    # use-cases
    # 1. general: just general lookup. find it wherever the heck it might be
    #   children: y
    #   parent: y
    #   dependent: y
    # 2. direct: only this namespace. we want to know what this namespace directly owns
    #   children: n
    #   parent: n
    #   dependent: n
    # 3. strict
    #   children: n
    #   parent: y
    #   dependent: n
    # 4. absolute
    #   children: y
    #   parent: n
    #   dependent: n
    # TODO: don't we have an enumerated class/project for this?
    module LookupMode
      GENERAL = :general
      RELAXED = :relaxed
      DIRECT = :direct
      STRICT = :strict
      ABSOLUTE = :absolute
      ALL = [GENERAL, RELAXED, DIRECT, STRICT, ABSOLUTE].freeze

      class << self
        def validate!(mode)
          unless ALL.include?(mode)
            # :nocov:
            raise ArgumentError, "Expected #{mode} to be one of #{ALL.map(&:inspect).join(",")}"
            # :nocov:
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.25 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.24 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.23 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.22 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.21 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.20 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.19 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.18 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.17 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.16 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.15 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.14 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.13 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.12 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.11 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.10 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.9 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.8 projects/namespace/src/namespace/lookup_mode.rb
foobara-0.0.7 projects/namespace/src/namespace/lookup_mode.rb