Module: Vident2::Internals::Registry

Defined in:
lib/vident2/internals/registry.rb

Defined Under Namespace

Classes: Kind

Constant Summary collapse

KINDS =
[
  Kind.new(:controllers, :controllers, :controller, Vident2::Stimulus::Controller, false),
  Kind.new(:actions,     :actions,     :action,     Vident2::Stimulus::Action,     false),
  Kind.new(:targets,     :targets,     :target,     Vident2::Stimulus::Target,     false),
  Kind.new(:outlets,     :outlets,     :outlet,     Vident2::Stimulus::Outlet,     true),
  Kind.new(:values,      :values,      :value,      Vident2::Stimulus::Value,      true),
  Kind.new(:params,      :params,      :param,      Vident2::Stimulus::Param,      true),
  Kind.new(:class_maps,  :classes,     :class,      Vident2::Stimulus::ClassMap,   true)
].freeze
BY_NAME =
KINDS.to_h { |k| [k.name, k] }.freeze

Class Method Summary collapse

Class Method Details

.each(&block) ⇒ Object



37
# File 'lib/vident2/internals/registry.rb', line 37

def self.each(&block) = KINDS.each(&block)

.fetch(name) ⇒ Object



36
# File 'lib/vident2/internals/registry.rb', line 36

def self.fetch(name) = BY_NAME.fetch(name)

.namesObject



38
# File 'lib/vident2/internals/registry.rb', line 38

def self.names = BY_NAME.keys