~michaelforrest/use-case-mapper/trunk

« back to all changes in this revision

Viewing changes to vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb

  • Committer: Richard Lee (Canonical)
  • Date: 2010-10-15 15:17:58 UTC
  • mfrom: (190.1.3 use-case-mapper)
  • Revision ID: richard.lee@canonical.com-20101015151758-wcvmfxrexsongf9d
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
module ActiveSupport #:nodoc:
2
 
  module CoreExtensions #:nodoc:
3
 
    module Base64 #:nodoc:
4
 
      module Encoding
5
 
        # Encodes the value as base64 without the newline breaks. This makes the base64 encoding readily usable as URL parameters 
6
 
        # or memcache keys without further processing.
7
 
        #
8
 
        #  ActiveSupport::Base64.encode64s("Original unencoded string") 
9
 
        #  # => "T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw=="
10
 
        def encode64s(value)
11
 
          encode64(value).gsub(/\n/, '')
12
 
        end
13
 
      end
14
 
    end
15
 
  end
16
 
end