Class: Cuprum::Collections::Constraints::Order::AttributesHash
- Inherits:
-
Stannum::Constraints::Types::HashType
- Object
- Stannum::Constraints::Types::HashType
- Cuprum::Collections::Constraints::Order::AttributesHash
- Defined in:
- lib/cuprum/collections/constraints/order/attributes_hash.rb
Overview
Asserts that the object is a Hash of attribute names and sort directions.
Class Method Summary collapse
-
.instance ⇒ Cuprum::Collections::Constraints::Order::AttributesArray
A cached instance of the constraint with default options.
Instance Method Summary collapse
-
#initialize(**options) ⇒ AttributesHash
constructor
A new instance of AttributesHash.
Constructor Details
#initialize(**options) ⇒ AttributesHash
Returns a new instance of AttributesHash.
18 19 20 21 22 23 24 25 |
# File 'lib/cuprum/collections/constraints/order/attributes_hash.rb', line 18 def initialize(**) super( key_type: Cuprum::Collections::Constraints::AttributeName.instance, value_type: Cuprum::Collections::Constraints::Order::SortDirection .instance, ** ) end |
Class Method Details
.instance ⇒ Cuprum::Collections::Constraints::Order::AttributesArray
Returns a cached instance of the constraint with default options.
12 13 14 |
# File 'lib/cuprum/collections/constraints/order/attributes_hash.rb', line 12 def self.instance @instance ||= new end |