Module: ValRequired
- Defined in:
- lib/val_required.rb,
lib/val_required/version.rb
Defined Under Namespace
Modules: Method Classes: BlankError, RequiredHelper
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.set?(obj) ⇒ Boolean
Returns false unless non-empty String or other non-nil object.
Class Method Details
.set?(obj) ⇒ Boolean
Returns false unless non-empty String or other non-nil object.
3 4 5 6 7 8 9 |
# File 'lib/val_required.rb', line 3 def self.set? obj if obj.instance_of? String !!(obj =~ /\S/) else !obj.nil? end end |