Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic implementations of core classes as_json
- Loading branch information
1 parent
8b098fc
commit 0314b1a
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |