Class: Bridgetown::Builders::PluginBuilder
- Inherits:
-
Object
- Object
- Bridgetown::Builders::PluginBuilder
- Includes:
- DSL::Generators, DSL::HTTP, DSL::Helpers, DSL::Hooks, DSL::Liquid
- Defined in:
- lib/bridgetown-builder/plugin.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#functions ⇒ Object
Returns the value of attribute functions.
-
#name ⇒ Object
Returns the value of attribute name.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
- #doc(path, &block) ⇒ Object
-
#initialize(name, current_site = nil) ⇒ PluginBuilder
constructor
A new instance of PluginBuilder.
- #inspect ⇒ Object
Methods included from DSL::Liquid
Methods included from DSL::HTTP
Methods included from DSL::Hooks
Methods included from DSL::Helpers
Methods included from DSL::Generators
Constructor Details
#initialize(name, current_site = nil) ⇒ PluginBuilder
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bridgetown-builder/plugin.rb', line 19 def initialize(name, current_site = nil) self.functions = Set.new self.name = name self.site = current_site || Bridgetown.sites.first self.config = if defined?(self.class::CONFIG_DEFAULTS) Bridgetown::Utils.deep_merge_hashes( self.class::CONFIG_DEFAULTS.with_dot_access, site.config ) else site.config end end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
17 18 19 |
# File 'lib/bridgetown-builder/plugin.rb', line 17 def config @config end |
#functions ⇒ Object
Returns the value of attribute functions.
17 18 19 |
# File 'lib/bridgetown-builder/plugin.rb', line 17 def functions @functions end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/bridgetown-builder/plugin.rb', line 17 def name @name end |
#site ⇒ Object
Returns the value of attribute site.
17 18 19 |
# File 'lib/bridgetown-builder/plugin.rb', line 17 def site @site end |
Instance Method Details
#doc(path, &block) ⇒ Object
37 38 39 |
# File 'lib/bridgetown-builder/plugin.rb', line 37 def doc(path, &block) DocumentsGenerator.add(path, block) end |
#inspect ⇒ Object
33 34 35 |
# File 'lib/bridgetown-builder/plugin.rb', line 33 def inspect "#{name} (Hook)" end |