inheritable_copy

inheritable_copy() Instance Public methods

decode

decode(json, options = {}) Class Public methods Parses a JSON string (JavaScript Object Notation) into a hash. See www.json.org for more info. ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") => {"team" => "rails", "players" => "36"}

encode

encode(value, options = nil) Class Public methods Dumps objects in JSON (JavaScript Object Notation). See www.json.org for more info. ActiveSupport::JSON.encode({ team: 'rails', players: '36' }) # => "{\"team\":\"rails\",\"players\":\"36\"}"

parse_error

parse_error() Class Public methods Returns the class of the error that will be raised when there is an error in decoding JSON. Using this method means you won't directly depend on the ActiveSupport's JSON implementation, in case it changes in the future. begin obj = ActiveSupport::JSON.decode(some_string) rescue ActiveSupport::JSON.parse_error Rails.logger.warn("Attempted to decode invalid JSON: #{some_string}") end

new

new(secret, options = {}) Class Public methods

generate_key

generate_key(salt, key_size=64) Instance Public methods Returns a derived key suitable for use. The default key_size is chosen to be compatible with the default settings of ActiveSupport::MessageVerifier. i.e. OpenSSL::Digest::SHA1#block_length

call

call(severity, timestamp, progname, msg) Instance Public methods This method is invoked when a log event occurs

new

new(*args) Class Public methods

new

new(level = DEBUG) Class Public methods

flush

flush() Instance Public methods