Class: ValidatesSubset::Arguments
- Inherits:
-
Object
- Object
- ValidatesSubset::Arguments
- Defined in:
- lib/arguments.rb
Overview
Wrapper class for arguments consumed by validates_with
Instance Method Summary collapse
-
#initialize(attribute_name, superset, options) ⇒ Arguments
constructor
A new instance of Arguments.
-
#to_validation_attributes ⇒ Object
format expected by _merge_attributes.
Constructor Details
#initialize(attribute_name, superset, options) ⇒ Arguments
Returns a new instance of Arguments.
10 11 12 13 14 |
# File 'lib/arguments.rb', line 10 def initialize(attribute_name, superset, ) @attribute_name = attribute_name @superset = superset @options = .is_a?(Hash) ? : {} end |
Instance Method Details
#to_validation_attributes ⇒ Object
format expected by _merge_attributes
return: <Array> - cardinality of 2
20 21 22 |
# File 'lib/arguments.rb', line 20 def to_validation_attributes [@attribute_name, ] end |