Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/day.rb

Overview

Force encoding change for Ruby 1.9

for more information see http://goo.gl/alaUM

Instance Method Summary collapse

Instance Method Details

#encode!Object



28
29
30
31
# File 'lib/day.rb', line 28

def encode!
  (defined?(Encoding) && self.respond_to?(:force_encoding)) ? 
    self.force_encoding('ASCII-8BIT') : self
end

#to_downcaseObject



33
34
35
36
# File 'lib/day.rb', line 33

def to_downcase
  (RUBY_VERSION < "1.9") ? 
    ::Unicode::downcase(self) : ::UnicodeUtils.downcase(self)
end