Module: Lorca::LorcaCore::LorcaExtension

Included in:
Lorca
Defined in:
lib/lorca.rb

Overview

LorcaCore class methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#settingsObject (readonly)

Lorca class settings/configuration hash.



37
38
39
# File 'lib/lorca.rb', line 37

def settings
  @settings
end

Instance Method Details

#add(expansion, **stns, &block) ⇒ Object

Adds a Lorca Expansion. An expansion is simply a module which changes Lorca. Methods defined under the ExpansionName::LorcaPlugin namespace get included. The ones defined under ExpansionName::LorcaExtension, extended.

Expansions can define ExpansionName.load_dependencies to load, and configure their dependencies. They can also define ExpansionName.configure so users can modify its settings. – don’t load from load_path; security over convenience ++



50
51
52
53
54
55
56
# File 'lib/lorca.rb', line 50

def add expansion, **stns, &block
  expansion.load_dependencies(self, **stns, &block) if expansion.respond_to?(:load_dependencies)
  include expansion::LorcaPlugin if defined? expansion::LorcaPlugin
  extend expansion::LorcaExtension if defined? expansion::LorcaExtension
  expansion.configure(self, **stns, &block) if expansion.respond_to?(:configure)
  self
end