Class: ActiveSupport::JSON::Variable

Inherits:
String show all
Defined in:
lib/active_support/json/variable.rb

Overview

Deprecated: A string that returns itself as its JSON-encoded form.

Constant Summary

Constants inherited from String

String::NON_WHITESPACE_REGEXP

Instance Method Summary collapse

Methods inherited from String

#acts_like_string?, #at, #blank?, #camelize, #classify, #constantize, #dasherize, #deconstantize, #demodulize, #encoding_aware?, #exclude?, #first, #foreign_key, #from, #html_safe, #humanize, #inquiry, #is_utf8?, #last, #mb_chars, #ord, #parameterize, #pluralize, #safe_constantize, #singularize, #squish, #squish!, #strip_heredoc, #tableize, #titleize, #to, #to_date, #to_datetime, #to_time, #truncate, #underscore

Constructor Details

#initialize(*args) ⇒ Variable

Returns a new instance of Variable.



7
8
9
10
11
# File 'lib/active_support/json/variable.rb', line 7

def initialize(*args)
  ActiveSupport::Deprecation.warn 'ActiveSupport::JSON::Variable is deprecated and will be removed in Rails 4.0. ' \
                                  'For your own custom JSON literals, define #as_json and #encode_json yourself.'
  super
end

Instance Method Details

#as_json(options = nil) ⇒ Object

:nodoc:



13
# File 'lib/active_support/json/variable.rb', line 13

def as_json(options = nil) self end

#encode_json(encoder) ⇒ Object

:nodoc:



14
# File 'lib/active_support/json/variable.rb', line 14

def encode_json(encoder) self end