Class: Bridgetown::Builders::PluginBuilder
- Inherits:
-
Object
- Object
- Bridgetown::Builders::PluginBuilder
- Includes:
- DSL::Generators, DSL::HTTP, DSL::Helpers, DSL::Hooks, DSL::Inspectors, DSL::Liquid, DSL::Resources, Prioritizable
- 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.
Class Method Summary collapse
Instance Method Summary collapse
- #doc ⇒ Object
-
#initialize(name = nil, current_site = nil) ⇒ PluginBuilder
constructor
A new instance of PluginBuilder.
Methods included from DSL::Resources
#add_resource, #define_resource_method, #permalink_placeholder, #placeholder_processors, #resource
Methods included from DSL::Liquid
#filters, #filters_context, #liquid_filter, #liquid_tag
Methods included from DSL::HTTP
Methods included from DSL::Inspectors
#inspect_html, #inspect_xml, process_html, process_xml, setup_nokogiri, setup_nokolexbor
Methods included from DSL::Hooks
Methods included from DSL::Helpers
Methods included from DSL::Generators
Constructor Details
#initialize(name = nil, current_site = nil) ⇒ PluginBuilder
Returns a new instance of PluginBuilder.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/bridgetown-builder/plugin.rb', line 40 def initialize(name = nil, current_site = nil) self.functions = Set.new self.name = name || self.class.name self.site = current_site || Bridgetown::Current.site self.config = if defined?(self.class::CONFIG_DEFAULTS) Deprecator.( "Using `CONFIG_DEFAULTS' in your builder is deprecated. " \ "Switch to defining config data via an initializer instead." ) 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.
32 33 34 |
# File 'lib/bridgetown-builder/plugin.rb', line 32 def config @config end |
#functions ⇒ Object
Returns the value of attribute functions.
32 33 34 |
# File 'lib/bridgetown-builder/plugin.rb', line 32 def functions @functions end |
#name ⇒ Object
Returns the value of attribute name.
32 33 34 |
# File 'lib/bridgetown-builder/plugin.rb', line 32 def name @name end |
#site ⇒ Object
Returns the value of attribute site.
32 33 34 |
# File 'lib/bridgetown-builder/plugin.rb', line 32 def site @site end |
Class Method Details
.plugin_registrations ⇒ Object
35 36 37 |
# File 'lib/bridgetown-builder/plugin.rb', line 35 def plugin_registrations @plugin_registrations ||= Set.new end |
Instance Method Details
#doc ⇒ Object
58 59 60 61 |
# File 'lib/bridgetown-builder/plugin.rb', line 58 def doc(*) raise Bridgetown::Errors::FatalException, "The `doc' method has been removed. Please use the `new_resource' builder DSL instead" end |