File: active_support/core_ext/base64/encoding.rb

Overview
Module Structure
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: ActiveSupport#1
  module: CoreExtensions#2
  module: Base64#3
  module: Encoding#4
has properties
method: encode64s / 1 #10

Code

   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