Class: ClientValidation::AdapterBase::ValidationResponse
- Inherits:
-
Object
- Object
- ClientValidation::AdapterBase::ValidationResponse
- Defined in:
- lib/client_validations/adapter_base/validation_response.rb
Overview
Currently this is used in the validates_uniqueness_of controller callback.
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(&block) ⇒ ValidationResponse
constructor
A new instance of ValidationResponse.
- #respond(params) ⇒ Object
Constructor Details
#initialize(&block) ⇒ ValidationResponse
Returns a new instance of ValidationResponse.
6 7 8 |
# File 'lib/client_validations/adapter_base/validation_response.rb', line 6 def initialize(&block) @proc = block end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/client_validations/adapter_base/validation_response.rb', line 5 def params @params end |
Instance Method Details
#respond(params) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/client_validations/adapter_base/validation_response.rb', line 10 def respond(params) @params = params return @proc.call(self) rescue nil end |