brianmario-yajl-ruby 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +9 -3
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -6,17 +6,23 @@ You can read more info at the projects website http://lloydforge.org/projects/ya
|
|
6
6
|
|
7
7
|
== Example of use
|
8
8
|
|
9
|
-
|
9
|
+
First, you're probably gonna want to include it:
|
10
|
+
|
11
|
+
include 'yajl'
|
12
|
+
|
13
|
+
Then maybe parse some JSON from:
|
14
|
+
|
15
|
+
a File IO
|
10
16
|
|
11
17
|
json_contents = File.new('test.json', 'r')
|
12
18
|
hash = Yajl::Native.parse(json)
|
13
19
|
|
14
|
-
|
20
|
+
or maybe a StringIO
|
15
21
|
|
16
22
|
json_contents = StringIO.new
|
17
23
|
hash = Yajl::Native.parse(json)
|
18
24
|
|
19
|
-
|
25
|
+
or maybe STDIN
|
20
26
|
|
21
27
|
cat someJsonFile.json | ruby -ryajl -e "puts Yajl::Native.parse(STDIN).inspect"
|
22
28
|
|