class Bridgetown::Plugin

Constants

PRIORITIES
SourceManifest

Public Class Methods

<=>(other) click to toggle source

Spaceship is priority [higher -> lower]

other - The class to be compared.

Returns -1, 0, 1.

# File lib/bridgetown-core/plugin.rb, line 36
def self.<=>(other)
  PRIORITIES[other.priority] <=> PRIORITIES[priority]
end
new(config = {}) click to toggle source

Initialize a new plugin. This should be overridden by the subclass.

config - The Hash of configuration options.

Returns a new instance.

# File lib/bridgetown-core/plugin.rb, line 54
def initialize(config = {})
  # no-op for default
end
priority(priority = nil) click to toggle source

Get or set the priority of this plugin. When called without an argument it returns the priority. When an argument is given, it will set the priority.

priority - The Symbol priority (default: nil). Valid options are:

:lowest, :low, :normal, :high, :highest

Returns the Symbol priority.

# File lib/bridgetown-core/plugin.rb, line 25
def self.priority(priority = nil)
  @priority ||= nil
  @priority = priority if priority && PRIORITIES.key?(priority)
  @priority || :normal
end

Public Instance Methods

<=>(other) click to toggle source

Spaceship is priority [higher -> lower]

other - The class to be compared.

Returns -1, 0, 1.

# File lib/bridgetown-core/plugin.rb, line 45
def <=>(other)
  self.class <=> other.class
end