Module: Bridgetown::Prioritizable

Included in:
Builders::PluginBuilder, Plugin, Rack::Routes
Defined in:
bridgetown-core/lib/bridgetown-core/concerns/prioritizable.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



31
32
33
34
# File 'bridgetown-core/lib/bridgetown-core/concerns/prioritizable.rb', line 31

def self.included(klass)
  klass.extend ClassMethods
  klass.class_attribute :priorities, instance_accessor: false
end

Instance Method Details

#<=>(other) ⇒ Integer

Spaceship is priority [higher -> lower]

Parameters:

  • other (object)

    The object to be compared.

Returns:

  • (Integer)

    -1, 0, 1.



40
41
42
# File 'bridgetown-core/lib/bridgetown-core/concerns/prioritizable.rb', line 40

def <=>(other)
  self.class <=> other.class
end