825件ヒット
[1-100件を表示]
(0.108秒)
種類
- インスタンスメソッド (473)
- 特異メソッド (209)
- モジュール関数 (121)
- 定数 (22)
クラス
- BigDecimal (22)
- Class (11)
- Complex (22)
- Date (22)
- DateTime (22)
- Exception (22)
-
JSON
:: Parser (33) -
JSON
:: State (165) - OpenStruct (22)
- Range (22)
- Rational (22)
- Regexp (22)
- Struct (22)
- Symbol (22)
- Time (22)
モジュール
- JSON (187)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kernel (33)
キーワード
- JSON (11)
-
VARIANT
_ BINARY (11) - VERSION (11)
-
array
_ nl (11) -
buffer
_ initial _ length (11) -
check
_ circular? (11) - configure (11)
-
create
_ id (11) - depth (11)
- dump (11)
-
fast
_ generate (11) -
fast
_ unparse (11) -
from
_ state (11) - generate (22)
- generator (11)
- indent (11)
- j (11)
- jj (11)
-
json
_ creatable? (11) -
json
_ create (143) - load (11)
-
max
_ nesting (11) - merge (11)
- new (11)
-
object
_ nl (11) - parse (22)
- parse! (11)
- parser (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
quirks
_ mode (11) -
quirks
_ mode? (11) - restore (11)
- source (11)
- space (11)
-
space
_ before (11) - state (11)
-
to
_ json (231) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) - unparse (11)
検索結果
先頭5件
- JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw _ object -> Hash - JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw -> String - Regexp
. json _ create(hash) -> Regexp - JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String - JSON
:: Generator :: GeneratorMethods :: String :: Extend . json _ create(hash) -> String
-
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw _ object -> Hash (12220.0) -
生の文字列を格納したハッシュを生成します。
...TF-8 の文字列ではなく生の文字列を JSON に変換する場合に使用してください。
require 'json'
"にほんご".encode("euc-jp").to_json_raw_object
# => {"json_class"=>"String", "raw"=>[164, 203, 164, 219, 164, 243, 164, 180]}
"にほんご".encode("euc-jp").to_json #......source sequence is illegal/malformed (JSON::GeneratorError)... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw -> String (12202.0) -
自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
...自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
@see JSON::Generator::GeneratorMethods::String#to_json_raw_object, JSON::Generator::GeneratorMethods::Hash#to_json... -
Regexp
. json _ create(hash) -> Regexp (9301.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
...
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。... -
JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String (9202.0) -
自身から生成した JSON 形式の文字列を返します。
...自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を......指定します。
//emlist[例][ruby]{
require "json"
[1, 2, 3].to_json # => "[1,2,3]"
//}... -
JSON
:: Generator :: GeneratorMethods :: String :: Extend . json _ create(hash) -> String (9202.0) -
JSON のオブジェクトから Ruby の文字列を生成して返します。
...
JSON のオブジェクトから Ruby の文字列を生成して返します。
@param hash キーとして "raw" という文字列を持ち、その値として数値の配列を持つハッシュを指定します。
require 'json'
String.json_create({"raw" => [0x41, 0x42, 0x43]}) # => "A... -
JSON
:: Parser # parse -> object (9202.0) -
現在のソースをパースして結果を Ruby のオブジェクトとして返します。
...を Ruby のオブジェクトとして返します。
//emlist[例][ruby]{
require 'json'
class Person
attr_accessor :name, :age
def []=(key, value)
instance_variable_set("@#{key}", value)
end
end
parser = JSON::Parser.new(DATA.read, object_class: Person)
person = parser.parse
person.......class # => Person
person.name # => "tanaka"
person.age # => 20
__END__
{
"name":"tanaka",
"age":20
}
//}
@see JSON::Parser#source... -
JSON
. # restore(source , proc = nil , options = {}) -> object (6302.0) -
与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。
... JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。
proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。
require 'json'
str=<<JSON
[1,2,3]
JSON......
JSON.load(str) # => [1,2,3]
JSON.load(str, proc{|v| p v }) # => [1,2,3]
# 以下が表示される
# 1
# 2
# 3
# [1,2,3]
str=<<JSON
{ "a":1, "b":2, "c":3 }
JSON
JSON.load(str) # => {"a"=>1, "b"=>2, "c"=>3}
JSON.load(str, proc{|v| p v }) # => {"a"=>1, "b"=>2, "c"=>3}......"c"
# 3
# {"a"=>1, "b"=>2, "c"=>3}
@param source JSON 形式の文字列を指定します。他には、to_str, to_io, read メソッドを持つオブジェクトも指定可能です。
@param proc Proc オブジェクトを指定します。
@param options オプションをハッシュ... -
JSON
. generator -> JSON :: Ext :: Generator (6302.0) -
JSON ライブラリがジェネレータとして使用するモジュールを返します。
...
JSON ライブラリがジェネレータとして使用するモジュールを返します。... -
JSON
. parser -> JSON :: Ext :: Parser (6302.0) -
JSON ライブラリがパーサとして使用するクラスを返します。
...
JSON ライブラリがパーサとして使用するクラスを返します。
//emlist[例][ruby]{
require "json"
JSON.parser # => JSON::Ext::Parser
//}... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (6214.0) -
自身から生成した JSON 形式の文字列を返します。
...ら生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字......に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
puts "test".to_json # => "test"
puts '"'.to_json #......=> "\""
puts "\\".to_json # => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}...