Module: Bridgetown::Commands::Registrations

Defined in:
bridgetown-core/lib/bridgetown-core/commands/registrations.rb

Class Method Summary collapse

Class Method Details

.load_registrations(command) ⇒ Object



16
17
18
19
20
21
# File 'bridgetown-core/lib/bridgetown-core/commands/registrations.rb', line 16

def self.load_registrations(command)
  registrations.each do |block|
    command.instance_exec(&block)
  end
  @registrations = []
end

.register(klass = nil, name = nil, &block) ⇒ Object



10
11
12
13
14
# File 'bridgetown-core/lib/bridgetown-core/commands/registrations.rb', line 10

def self.register(klass = nil, name = nil, &block)
  block ||= proc { register(klass, name) }

  registrations << block
end

.registrationsObject



6
7
8
# File 'bridgetown-core/lib/bridgetown-core/commands/registrations.rb', line 6

def self.registrations
  @registrations ||= []
end