Class: String
- Defined in:
- lib/ruby_smart/support/core_ext/ruby/string.rb,
lib/ruby_smart/support/core_ext/ruby/string.rb
Instance Method Summary collapse
-
#to_boolean ⇒ Boolean
converts a string to 'boolean'.
-
#to_md5 ⇒ String
returns the md5 of this string.
Instance Method Details
#to_boolean ⇒ Boolean
converts a string to 'boolean'
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_md5 ⇒ String
returns the md5 of this string
19 20 21 |
# File 'lib/ruby_smart/support/core_ext/ruby/string.rb', line 19 def to_md5 ::Digest::MD5.hexdigest(self) end |