Sha256: ed0c10400e41452fea22b16f19bebff4e23bcaf1e07a3be5f42ff7e89a1e3cee

Contents?: true

Size: 375 Bytes

Versions: 6

Compression:

Stored size: 375 Bytes

Contents

require 'json'

class Object
  def as_json
    nil
  end
end

class Boolean
  def as_json
    self
  end
end

class NilClass
  def as_json
    self
  end
end

class Numeric
  def as_json
    self
  end
end

class String
  def as_json
    self
  end
end

class Array
  def as_json(options = nil) #:nodoc:
    map { |v| options ? v.as_json(options.dup) : v.as_json }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-activesupport-0.3.3 opal/active_support/core_ext/object/json.rb
opal-activesupport-0.3.2 opal/active_support/core_ext/object/json.rb
opal-activesupport-0.3.1 opal/active_support/core_ext/object/json.rb
opal-activesupport-0.3.0 opal/active_support/core_ext/object/json.rb
opal-activesupport-0.2.0 opal/active_support/core_ext/object/json.rb
opal-activesupport-0.1.0 opal/active_support/core_ext/object/json.rb