Class: Monolens::Check::NotEmpty
- Inherits:
-
Object
- Object
- Monolens::Check::NotEmpty
show all
- Includes:
- Lens
- Defined in:
- lib/monolens/stdlib/check/not_empty.rb
Instance Attribute Summary
Attributes included from Lens
#options
Instance Method Summary
collapse
Methods included from Lens
#fail!, included, #initialize
#fetch_on
Instance Method Details
#call(arg, world = {}) ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/monolens/stdlib/check/not_empty.rb', line 12
def call(arg, world = {})
if arg.nil?
do_fail!(arg, world)
elsif arg.respond_to?(:empty?) && arg.empty?
do_fail!(arg, world)
else
arg
end
end
|