Skip to content

Commit

Permalink
Add basic implementations of core classes as_json
Browse files Browse the repository at this point in the history
adambeynon committed Nov 28, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
Original file line number Diff line number Diff line change
@@ -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.