Module: Vident::Internals::Registry

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

Defined Under Namespace

Classes: Kind

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.each(&block) ⇒ Object



32
# File 'lib/vident/internals/registry.rb', line 32

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

.fetch(name) ⇒ Object



30
# File 'lib/vident/internals/registry.rb', line 30

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

.namesObject



34
# File 'lib/vident/internals/registry.rb', line 34

def self.names = BY_NAME.keys