Module: ActiveSupport::CoreExtensions::String::Unicode
- Included in:
- String
- Defined in:
- lib/active_support/core_ext/string/unicode.rb
Overview
Define methods for handling unicode data.
Class Method Summary collapse
Instance Method Summary collapse
-
#chars ⇒ Object
:nodoc:.
-
#is_utf8? ⇒ Boolean
:nodoc:.
Class Method Details
.append_features(base) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/active_support/core_ext/string/unicode.rb', line 6 def self.append_features(base) if '1.8.7 and later'.respond_to?(:chars) base.class_eval { remove_method :chars } end super end |
Instance Method Details
#chars ⇒ Object
:nodoc:
38 39 40 |
# File 'lib/active_support/core_ext/string/unicode.rb', line 38 def chars ActiveSupport::Multibyte::Chars.new(self) end |
#is_utf8? ⇒ Boolean
:nodoc:
44 45 46 |
# File 'lib/active_support/core_ext/string/unicode.rb', line 44 def is_utf8? ActiveSupport::Multibyte::Handlers::UTF8Handler.consumes?(self) end |