Class: Resto::Validate::Inclusion
- Inherits:
-
Object
- Object
- Resto::Validate::Inclusion
show all
- Includes:
- Resto::Validate
- Defined in:
- lib/resto/validate/inclusion.rb
Instance Method Summary
collapse
#if, #message, #unless, #validate?
Constructor Details
Returns a new instance of Inclusion.
8
9
10
11
|
# File 'lib/resto/validate/inclusion.rb', line 8
def initialize
@allow_nil = false
@allow_blank = false
end
|
Instance Method Details
#allow_blank ⇒ Object
21
22
23
|
# File 'lib/resto/validate/inclusion.rb', line 21
def allow_blank
tap { @allow_blank = true }
end
|
#allow_nil ⇒ Object
17
18
19
|
# File 'lib/resto/validate/inclusion.rb', line 17
def allow_nil
tap { @allow_nil = true }
end
|
#in(range) ⇒ Object
13
14
15
|
# File 'lib/resto/validate/inclusion.rb', line 13
def in(range)
tap { @range = range }
end
|