Missing String#ord in Ruby 1.8? Here’s a simple monkey-patch that will add it to Ruby.
unless "".respond_to?(:ord)
class String
def ord
self[0].ord
end
end
endMissing String#ord in Ruby 1.8? Here’s a simple monkey-patch that will add it to Ruby.
unless "".respond_to?(:ord)
class String
def ord
self[0].ord
end
end
end