Module: Foobara::Namespace::LookupMode

Defined in:
foobara-0.1.7/projects/namespace/src/namespace/lookup_mode.rb

Overview

TODO: need to define these better/more intuitively use-cases

  1. general: just general lookup. find it wherever the heck it might be

children: y
parent: y
dependent: y
  1. direct: only this namespace. we want to know what this namespace directly owns

children: n
parent: n
dependent: n
  1. strict

children: n
parent: y
dependent: n
  1. absolute

children: y
parent: n
dependent: y
  1. absolute_single_namespace

children: y
parent: n
dependent: n
  1. children_only (internal use… absolute and absolute_single_namespace jump to top, children only does not)

children: y
parent: n
dependent: n

TODO: don’t we have an enumerated class/project for this?

Constant Summary collapse

GENERAL =
:general
RELAXED =
:relaxed
DIRECT =
:direct
STRICT =
:strict
ABSOLUTE =
:absolute
ABSOLUTE_SINGLE_NAMESPACE =
:absolute_single_namespace
CHILDREN_ONLY =
:children_only
ALL =
[GENERAL, RELAXED, DIRECT, STRICT, ABSOLUTE, ABSOLUTE_SINGLE_NAMESPACE, CHILDREN_ONLY].freeze

Class Method Summary collapse

Class Method Details

.validate!(mode) ⇒ Object



42
43
44
45
46
47
48
# File 'foobara-0.1.7/projects/namespace/src/namespace/lookup_mode.rb', line 42

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