instance method valenc

Ruby on Rails 3.0.20

Since v2.3.18 Last seen in v3.0.20

Available in: v2.3.18 v3.0.20

Signature

valenc(x)

No documentation comment.

Parameters

x req
Source
# File activesupport/lib/active_support/json/backends/okjson.rb, line 417
    def valenc(x)
      case x
      when Hash    then objenc(x)
      when Array   then arrenc(x)
      when String  then strenc(x)
      when Numeric then numenc(x)
      when true    then "true"
      when false   then "false"
      when nil     then "null"
      else
        raise Error, "cannot encode #{x.class}: #{x.inspect}"
      end
    end

Defined in activesupport/lib/active_support/json/backends/okjson.rb line 417 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::OkJson

Type at least 2 characters to search.

↑↓ navigate · open · esc close