Module: Praxis::PluginConcern::ClassMethods

Defined in:
lib/praxis/plugin_concern.rb

Constant Summary collapse

PLUGIN_CLASSES =
%i[
  Request
  Controller
  EndpointDefinition
  ActionDefinition
  Response
  ApiGeneralInfo
].freeze

Instance Method Summary collapse

Instance Method Details

#inject!(name) ⇒ Object



31
32
33
34
35
36
# File 'lib/praxis/plugin_concern.rb', line 31

def inject!(name)
  plugin = const_get(name)
  praxis = Praxis.const_get(name)

  praxis.include(plugin)
end

#setup!Object



21
22
23
24
25
26
27
28
29
# File 'lib/praxis/plugin_concern.rb', line 21

def setup!
  return if @setup

  PLUGIN_CLASSES.each do |name|
    inject!(name) if constants.include?(name)
  end

  @setup = true
end