Class: ValidatesType::Arguments
- Inherits:
-
Object
- Object
- ValidatesType::Arguments
- Defined in:
- lib/arguments.rb
Overview
Wrapper class for arguments consumed by validates_with
Instance Method Summary collapse
-
#initialize(attribute_name, attribute_type, options) ⇒ Arguments
constructor
A new instance of Arguments.
-
#to_validation_attributes ⇒ Object
format expected by _merge_attributes.
Constructor Details
#initialize(attribute_name, attribute_type, options) ⇒ Arguments
Returns a new instance of Arguments.
10 11 12 13 14 |
# File 'lib/arguments.rb', line 10 def initialize(attribute_name, attribute_type, ) @attribute_name = attribute_name @attribute_type = attribute_type = .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 |