Class: ThinkingSphinx::UTF8
- Inherits:
-
Object
- Object
- ThinkingSphinx::UTF8
- Defined in:
- lib/thinking_sphinx/utf8.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(string) ⇒ UTF8
constructor
A new instance of UTF8.
Constructor Details
#initialize(string) ⇒ UTF8
Returns a new instance of UTF8.
10 11 12 |
# File 'lib/thinking_sphinx/utf8.rb', line 10 def initialize(string) @string = string end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
4 5 6 |
# File 'lib/thinking_sphinx/utf8.rb', line 4 def string @string end |
Class Method Details
.encode(string) ⇒ Object
6 7 8 |
# File 'lib/thinking_sphinx/utf8.rb', line 6 def self.encode(string) new(string).encode end |
Instance Method Details
#encode ⇒ Object
14 15 16 17 |
# File 'lib/thinking_sphinx/utf8.rb', line 14 def encode string.encode!('ISO-8859-1') string.force_encoding('UTF-8') end |