-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
65 lines (46 loc) · 1.35 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
= jsonbuilder
by nov http://github.com/nov <nov@cerego.com> and
birkirb http://github.com/birkirb
== Description
== Installation
git clone http://github.com/nov/jsonbuilder.git
cd jsonbuilder
rake install
=== Archive Installation
rake install
=== Gem Installation
gem install jsonbuilder --source http://gems.rubyforge.org
OR for the lastest development version
gem install nov-jsonbuilder --source http://gems.github.com
== Features/Problems
The Hash builder will return a hash structured in a similar way as the corresponding xml
built by XmlMarkup. The Json builder will return the same kind of hash as a JSON string
USAGE:
def serialize(builder, options = {})
builder.user(
:id => id,
:url => url
)
builder.array_mode do
builder.images do
package.images.each do |image|
builder << image.builder(builder.class.new, :only_url => true)
end
end
end
builder.target!
end
def to_xml(options = {})
self.serialize(Builder::XMmlMarkup.new, options)
end
def to_hash(options = {})
self.serialize(Builder::HashStructure.new, options)
end
def to_json(options = {})
self.serialize(Builder::JsonFormat.new, options)
end
== Synopsis
== Copyright
Author:: nov <nov@matake.jp> and birkirb
Copyright:: Copyright (c) 2009 nov
License:: MIT License