Class: String

Inherits:
Object
  • Object
show all
Includes:
Term::ANSIColor
Defined in:
lib/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/core_ext/string.rb', line 18

def blank?
  self == ""
end

#to_dateObject



9
10
11
12
13
14
15
16
# File 'lib/core_ext/string.rb', line 9

def to_date
  begin
    date = DateTime.parse(self)
  rescue
    date = nil
  end
  date
end