Module: MediaWikiVagrant::SettingsDefiner

Included in:
Settings
Defined in:
lib/mediawiki-vagrant/settings_definer.rb

Defined Under Namespace

Modules: Macros

Class Method Summary collapse

Class Method Details

.included(other) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mediawiki-vagrant/settings_definer.rb', line 3

def self.included(other)
  super

  class << other
    def definitions
      @definitions_hash.each.with_object({}) do |(key, setting), hash|
        hash[key] = setting.dup
      end
    end

    protected

    attr_reader :definitions_hash
  end

  other.class_exec { @definitions_hash ||= {} }
  other.extend(Macros)
end