Skip to content

Commit

Permalink
Add basic implementations of core classes as_json
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 28, 2013
1 parent 8b098fc commit 0314b1a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions opal/active_support/core_ext/object/json.rb
@@ -0,0 +1,31 @@
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

0 comments on commit 0314b1a

Please sign in to comment.