Class: Cuprum::Collections::Constraints::Order::AttributesArray

Inherits:
Stannum::Constraints::Types::ArrayType
  • Object
show all
Defined in:
lib/cuprum/collections/constraints/order/attributes_array.rb

Overview

Asserts that the object is an Array of attribute names.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ AttributesArray

Returns a new instance of AttributesArray.

Parameters:

  • options (Hash<Symbol, Object>)

    Configuration options for the constraint. Defaults to an empty Hash.



19
20
21
22
23
24
# File 'lib/cuprum/collections/constraints/order/attributes_array.rb', line 19

def initialize(**options)
  super(
    item_type: Cuprum::Collections::Constraints::AttributeName.instance,
    **options
  )
end

Class Method Details

.instanceCuprum::Collections::Constraints::Order::AttributesArray

Returns a cached instance of the constraint with default options.

Returns:



13
14
15
# File 'lib/cuprum/collections/constraints/order/attributes_array.rb', line 13

def self.instance
  @instance ||= new
end