Searched refs:to_json (Results 1 - 25 of 37) sorted by relevance

12

/macosx-10.9.5/CPANInternal-140/JSON-2.53/t/
H A De90_misc.t14 eval { JSON->to_json( 5, { allow_nonref => 1 } ) };
17 is( q{"5"}, JSON::to_json( "5", { allow_nonref => 1 } ) );
18 is( q{5}, JSON::to_json( 5, { allow_nonref => 1 } ) );
19 is( q{"JSON"}, JSON::to_json( 'JSON', { allow_nonref => 1 } ) );
/macosx-10.9.5/ruby-104/ruby/test/psych/
H A Dtest_json_tree.rb6 assert_match(/"foo"/, Psych.to_json("foo"))
10 assert_match(/"foo"/, Psych.to_json(:foo))
14 assert_match(/^null/, Psych.to_json(nil))
18 assert_match(/^10/, Psych.to_json(10))
22 assert_match(/^1.2/, Psych.to_json(1.2))
27 json = Psych.to_json(hash)
41 json = Psych.to_json Bar.new
47 json = Psych.to_json(list)
57 Psych.to_json({'a' => time })
62 assert_equal "{\"a\": \"#{time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")}\"}\n", Psych.to_json({'
[all...]
/macosx-10.9.5/ruby-104/ruby/ext/json/lib/json/add/
H A Dbigdecimal.rb25 def to_json(*) method in class:BigDecimal
26 as_json.to_json
H A Dcomplex.rb19 def to_json(*) method in class:Complex
20 as_json.to_json
H A Drange.rb9 # <tt>a</tt> serialized by <tt>to_json</tt>.
26 def to_json(*args) method in class:Range
27 as_json.to_json(*args)
H A Drational.rb19 def to_json(*) method in class:Rational
20 as_json.to_json
H A Dregexp.rb10 # <tt>to_json</tt>
27 def to_json(*) method in class:Regexp
28 as_json.to_json
H A Dsymbol.rb17 def to_json(*a) method in class:Symbol
18 as_json.to_json(*a)
H A Ddate.rb31 def to_json(*args) method in class:Date
32 as_json.to_json(*args)
H A Dexception.rb9 # <tt>m</tt> and backtrace <tt>b</tt> serialized with <tt>to_json</tt>
28 def to_json(*args) method in class:Exception
29 as_json.to_json(*args)
H A Dostruct.rb10 # <tt>v</tt> serialized by <tt>to_json</tt>.
28 def to_json(*args) method in class:OpenStruct
29 as_json.to_json(*args)
H A Dstruct.rb9 # <tt>v</tt> serialized by <tt>to_json</tt>.
27 def to_json(*args) method in class:Struct
28 as_json.to_json(*args)
H A Dtime.rb35 def to_json(*args) method in class:Time
36 as_json.to_json(*args)
H A Ddate_time.rb45 def to_json(*args) method in class:DateTime
46 as_json.to_json(*args)
/macosx-10.9.5/ruby-104/ruby/test/json/
H A Dtest_json_unicode.rb11 assert_equal '""', ''.to_json
12 assert_equal '"\\b"', "\b".to_json
13 assert_equal '"\u0001"', 0x1.chr.to_json
14 assert_equal '"\u001f"', 0x1f.chr.to_json
15 assert_equal '" "', ' '.to_json
16 assert_equal "\"#{0x7f.chr}\"", 0x7f.chr.to_json
19 assert_equal json, utf8.to_json(:ascii_only => false)
22 assert_equal json, utf8.to_json(:ascii_only => true)
27 assert_equal json, utf8.to_json(:ascii_only => false)
31 assert_equal json, utf8.to_json(
[all...]
H A Dtest_json_addition.rb31 def to_json(*args) method in class:TestJSONAddition.A
35 }.to_json(*args)
40 def to_json(*args) method in class:TestJSONAddition.A2
44 }.to_json(*args)
53 def to_json(*args) method in class:TestJSONAddition.B
56 }.to_json(*args)
65 def to_json(*args) method in class:TestJSONAddition.C
68 }.to_json(*args)
171 assert_equal d, JSON.parse(d.to_json, :create_additions => true)
173 assert_equal d, JSON.parse(d.to_json,
[all...]
H A Dtest_json_string_matching.rb17 def to_json(*) method in class:TestJSONStringMatching.TestTime
28 t_json = [ t ].to_json
H A Dtest_json.rb211 def to_json(*a) method in class:SubArray2
215 }.to_json(*a)
278 def to_json(*a) method in class:SubHash2
281 }.merge(self).to_json(*a)
/macosx-10.9.5/CPANInternal-140/JSON-Any/t/
H A D03-JSON-DWIW.t18 $js = $json->to_json( { var1 => "val2" } );
H A D00-load.t24 can_ok( JSON::Any, qw(to_json from_json ) );
/macosx-10.9.5/CPANInternal-140/JSON-Any-1.29/t/
H A D00-load.t24 can_ok( JSON::Any, qw(to_json from_json ) );
H A D03-JSON-DWIW.t18 $js = $json->to_json( { var1 => "val2" } );
/macosx-10.9.5/ruby-104/ruby/ext/json/lib/json/
H A Dgeneric_object.rb57 def to_json(*a) method in class:JSON
58 as_json.to_json(*a)
/macosx-10.9.5/ruby-104/ruby/test/ruby/
H A Dtest_refinement.rb581 def to_json; to_s; end method in class:TestRefinement.FixnumPlusExt.RefineSameClass.foo.bar.ToJSON
585 def to_json; "[" + map { |i| i.to_json }.join(",") + "]" end method in class:TestRefinement.FixnumPlusExt.RefineSameClass.foo.bar.ToJSON
589 def to_json; "{" + map { |k, v| k.to_s.dump + ":" + v.to_json }.join(",") + "}" end method in class:TestRefinement.FixnumPlusExt.RefineSameClass.foo.bar.ToJSON
594 x = eval_using(ToJSON, "[{1=>2}, {3=>4}].to_json")
/macosx-10.9.5/ruby-104/ruby/ext/psych/lib/
H A Dpsych.rb264 def self.to_json o singleton method in class:Psych

Completed in 123 milliseconds

12