jsoning 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -1
- data/lib/jsoning.rb +5 -0
- data/lib/jsoning/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab99aea4b1e32c8cb1dd3b9ef9629de18fe57af5
|
4
|
+
data.tar.gz: c33e1687f59d31bed9ddbf1d299b9ad9b1bc81e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf0371b9055dce314f1a4400f192de4dbe1f886761d2accf30816d6256db22a1aae8175d9ea755a5d8327bb88dfce74dd77920c13482d872940a292cd8f508c8
|
7
|
+
data.tar.gz: 5607608a6b053dfc67bd37952da6e590e56e015ce012fd7701e5702b85becbe651b61f8c203dc8e5f62276782a520cc9de58d1b4dca7190e0f1c379ef2564cc6
|
data/README.md
CHANGED
@@ -23,6 +23,11 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
$ gem install jsoning
|
25
25
|
|
26
|
+
## What it can do?
|
27
|
+
|
28
|
+
1. Generating JSON from your object
|
29
|
+
2. Generating Hash from your object
|
30
|
+
|
26
31
|
## Assumptions
|
27
32
|
|
28
33
|
We have classes already defined as follow:
|
@@ -164,7 +169,33 @@ Jsoning the user with pretty set to true, will return:
|
|
164
169
|
}
|
165
170
|
```
|
166
171
|
|
167
|
-
|
172
|
+
## Returning Hash
|
173
|
+
|
174
|
+
It is also possible to return hash as well:
|
175
|
+
|
176
|
+
```ruby
|
177
|
+
Jsoning[user]
|
178
|
+
```
|
179
|
+
|
180
|
+
The syntax above will return ruby hash object:
|
181
|
+
|
182
|
+
```ruby
|
183
|
+
{"name"=>"Adam Baihaqi",
|
184
|
+
"years_old"=>21,
|
185
|
+
"gender"=>"male",
|
186
|
+
"books"=>[{"name"=>"Quiet: The Power of Introvert"}, {"name"=>"Harry Potter and the Half-Blood Prince"}],
|
187
|
+
"degree_detail"=>{"faculty"=>"School of IT", "degree"=>"B.Sc. (Hons) Computer Science"}}
|
188
|
+
```
|
189
|
+
|
190
|
+
## Changelog
|
191
|
+
|
192
|
+
== Version 0.1.0
|
193
|
+
|
194
|
+
1. Ability to turn object into JSON
|
195
|
+
|
196
|
+
== Version 0.2.0
|
197
|
+
|
198
|
+
2. Ability to turn object into a hash
|
168
199
|
|
169
200
|
## License
|
170
201
|
|
data/lib/jsoning.rb
CHANGED
data/lib/jsoning/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsoning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Pahlevi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|