module Net::IMAP::PartialRange::StringFormatter
Constants
- LITERAL_REGEX
Public Instance Methods
Source
# File lib/net/imap/command_data.rb, line 313 def nstring(str) str.nil? ? nil : string(str) end
coerces non-nil using to_s
Source
# File lib/net/imap/command_data.rb, line 303 def string(str) str = str.to_s if str =~ LITERAL_REGEX Literal.new(str) else QuotedString.new(str) end end
coerces using to_s
Source
# File lib/net/imap/command_data.rb, line 298 def valid_nstring?(str) str.nil? || valid_string?(str) end
Allows nil, symbols, and strings
Source
# File lib/net/imap/command_data.rb, line 293 def valid_string?(str) str.is_a?(Symbol) || str.respond_to?(:to_str) end
Allows symbols in addition to strings