Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/mail/core_extensions/string.rb
Overview
:nodoc:
Constant Summary collapse
- US_ASCII_REGEXP =
Provides all strings with the Ruby 1.9 method of .ascii_only? and returns true or false
%Q{\x00-\x7f}
Instance Method Summary collapse
Instance Method Details
#ascii_only? ⇒ Boolean
15 16 17 |
# File 'lib/mail/core_extensions/string.rb', line 15 def ascii_only? !(self =~ /[^#{US_ASCII_REGEXP}]/) end |
#not_ascii_only? ⇒ Boolean
20 21 22 |
# File 'lib/mail/core_extensions/string.rb', line 20 def not_ascii_only? !ascii_only? end |
#to_crlf ⇒ Object
3 4 5 |
# File 'lib/mail/core_extensions/string.rb', line 3 def to_crlf gsub(/\n|\r\n|\r/) { "\r\n" } end |
#to_lf ⇒ Object
7 8 9 |
# File 'lib/mail/core_extensions/string.rb', line 7 def to_lf gsub(/\n|\r\n|\r/) { "\n" } end |