Module: Priora

Defined in:
lib/priora.rb,
lib/priora/errors.rb,
lib/priora/version.rb,
lib/priora/priority.rb,
lib/priora/collection.rb,
lib/priora/class_methods.rb,
lib/priora/configuration.rb,
lib/priora/priority_builder.rb

Defined Under Namespace

Modules: ClassMethods Classes: Collection, Configuration, InvalidConversionLambda, InvalidPrioritySyntaxError, Priority, PriorityBuilder, UnsuppliedPrioritiesError

Constant Summary collapse

VERSION =
'0.1.1'.freeze

Class Method Summary collapse

Class Method Details

.configurationObject


10
11
12
# File 'lib/priora.rb', line 10

def configuration
  @configuration ||= Configuration.new
end

.included(base_class) ⇒ Object


14
15
16
# File 'lib/priora.rb', line 14

def included(base_class)
  base_class.extend ClassMethods
end

.prioritize(collection, by: nil) ⇒ Object


18
19
20
21
22
# File 'lib/priora.rb', line 18

def prioritize(collection, by: nil)
  raw_priorities = by
  priorities = priorities_from_call(collection, raw_priorities)
  Collection.new(collection).prioritize_by(priorities)
end