File: one_shot.rb

package info (click to toggle)
ruby-yajl 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,980 kB
  • sloc: ansic: 2,473; ruby: 2,049; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 332 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../..')
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../../lib')

require 'yajl'

obj = {
  :a_test => "of encoding in one pass",
  :which_will => "simply return a string when finished",
  :as_easy_as => 123
}

str = Yajl::Encoder.encode(obj)
puts str