Class: WeakHeaders::BaseValidator
- Inherits:
-
Object
- Object
- WeakHeaders::BaseValidator
show all
- Defined in:
- lib/weak_headers/base_validator.rb
Instance Method Summary
collapse
Constructor Details
#initialize(controller, key, options = {}, &block) ⇒ BaseValidator
3
4
5
6
7
8
|
# File 'lib/weak_headers/base_validator.rb', line 3
def initialize(controller, key, options = {}, &block)
@controller = controller
@key = key.to_s
@options = options
@block = block
end
|
Instance Method Details
#type ⇒ Object
14
15
16
|
# File 'lib/weak_headers/base_validator.rb', line 14
def type
self.class.name.split('::').last.sub(/Validator\z/, '').underscore.to_sym
end
|
#validate ⇒ Object
10
11
12
|
# File 'lib/weak_headers/base_validator.rb', line 10
def validate
handle_failure unless valid?
end
|