class Cuprum::Collections::Constraints::Order::AttributesHash

Asserts that the object is a Hash of attribute names and sort directions.

Public Class Methods

instance() click to toggle source

@return [Cuprum::Collections::Constraints::Order::AttributesArray] a

cached instance of the constraint with default options.
# File lib/cuprum/collections/constraints/order/attributes_hash.rb, line 12
def self.instance
  @instance ||= new
end
new(**options) click to toggle source

@param options [Hash<Symbol, Object>] Configuration options for the

constraint. Defaults to an empty Hash.
Calls superclass method
# File lib/cuprum/collections/constraints/order/attributes_hash.rb, line 18
def initialize(**options)
  super(
    key_type:   Cuprum::Collections::Constraints::AttributeName.instance,
    value_type: Cuprum::Collections::Constraints::Order::SortDirection
      .instance,
    **options
  )
end