Class: String

Inherits:
Object show all
Defined in:
lib/ruby_smart/support/core_ext/ruby/string.rb,
lib/ruby_smart/support/core_ext/ruby/string.rb

Instance Method Summary collapse

Instance Method Details

#to_booleanBoolean

converts a string to 'boolean'

Returns:

  • (Boolean)

    bool



9
10
11
# File 'lib/ruby_smart/support/core_ext/ruby/string.rb', line 9

def to_boolean
  !["0", "f", "false", "off",''].include?(self.downcase)
end

#to_md5String

returns the md5 of this string

Returns:



19
20
21
# File 'lib/ruby_smart/support/core_ext/ruby/string.rb', line 19

def to_md5
  ::Digest::MD5.hexdigest(self)
end