Class: Cuprum::Collections::Constraints::Order::SortDirection

Inherits:
Stannum::Constraints::Enum
  • Object
show all
Defined in:
lib/cuprum/collections/constraints/order/sort_direction.rb

Overview

Asserts that the object is a valid direction for a sort.

Constant Summary collapse

NEGATED_TYPE =

The :type of the error generated for a matching object.

'cuprum.collections.constraints.is_valid_sort_direction'
TYPE =

The :type of the error generated for a non-matching object.

'cuprum.collections.constraints.is_not_valid_sort_direction'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ SortDirection

Returns a new instance of SortDirection.



22
23
24
# File 'lib/cuprum/collections/constraints/order/sort_direction.rb', line 22

def initialize(**options)
  super(*sort_directions, **options)
end

Class Method Details

.instanceCuprum::Collections::Constraints::AttributeName

Returns a cached instance of the constraint with default options.

Returns:



18
19
20
# File 'lib/cuprum/collections/constraints/order/sort_direction.rb', line 18

def self.instance
  @instance ||= new
end