Class: Bridgetown::Builder

Inherits:
Bridgetown::Builders::PluginBuilder show all
Extended by:
ActiveSupport::DescendantsTracker
Defined in:
lib/bridgetown-builder/builder.rb

Overview

Superclass for a website’s SiteBuilder abstract class

Instance Attribute Summary

Attributes inherited from Bridgetown::Builders::PluginBuilder

#config, #functions, #name, #site

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Bridgetown::Builders::PluginBuilder

#doc

Methods included from Bridgetown::Builders::DSL::Liquid

#liquid_filter, #liquid_tag

Methods included from Bridgetown::Builders::DSL::HTTP

#connection, #get

Methods included from Bridgetown::Builders::DSL::Hooks

#add_data, #hook

Methods included from Bridgetown::Builders::DSL::Helpers

#helper

Methods included from Bridgetown::Builders::DSL::Generators

#generator

Constructor Details

#initialize(name, current_site = nil) ⇒ Builder

Subclass is expected to implement #build



17
18
19
20
# File 'lib/bridgetown-builder/builder.rb', line 17

def initialize(name, current_site = nil)
  super(name, current_site)
  build
end

Class Method Details

.descendantsObject



26
27
28
# File 'lib/bridgetown-builder/builder.rb', line 26

def self.descendants
  super.reject { |klass| ["SiteBuilder"].include?(klass.name) }
end

.registerObject



9
10
11
12
13
# File 'lib/bridgetown-builder/builder.rb', line 9

def register
  Bridgetown::Hooks.register_one :site, :pre_read, reloadable: false do |site|
    new(name, site)
  end
end

Instance Method Details

#inspectObject



22
23
24
# File 'lib/bridgetown-builder/builder.rb', line 22

def inspect
  name
end