Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/rubyfocus/core_ext.rb
Class Method Summary collapse
-
.safely_parse(val) ⇒ Object
Will return nil if
val
is nil or a blank string.
Class Method Details
.safely_parse(val) ⇒ Object
Will return nil if val
is nil or a blank string. Otherwise, will parse as normal using Time.parse
4 5 6 7 8 9 10 |
# File 'lib/rubyfocus/core_ext.rb', line 4 def self.safely_parse(val) if val.nil? || val == "" nil else parse(val) end end |