module Lipstick::Sortable

Constants

DIRECTIONS

Public Class Methods

direction(direction) click to toggle source
# File lib/lipstick/sortable.rb, line 8
def direction(direction)
  direction = DIRECTIONS.find { |x| x == direction&.downcase }
  direction ||= DIRECTIONS.first

  direction
end
included(base) click to toggle source
# File lib/lipstick/sortable.rb, line 40
def self.included(base)
  base.extend(ClassMethods)
end
opposite_direction(direction) click to toggle source
# File lib/lipstick/sortable.rb, line 15
def opposite_direction(direction)
  (DIRECTIONS - [direction(direction)]).first
end