Class: ClientValidation::AdapterBase::ValidationResponse

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#paramsObject (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