るりまサーチ

最速Rubyリファレンスマニュアル検索!
60件ヒット [1-60件を表示] (0.022秒)

別のキーワード

  1. encoding windows_31j
  2. encoding cswindows31j
  3. _builtin windows_31j
  4. _builtin cswindows31j
  5. json j

ライブラリ

クラス

キーワード

検索結果

JSON::Parser#source -> String (21108.0)

現在のソースのコピーを返します。

...現在のソースのコピーを返します。

//emlist[例][ruby]{
require 'json'

parser = JSON::Parser.new(DATA.read)
print parser.source

# => {
# => "Tanaka": {
# => "name":"tanaka",
# => "age":20
# => },
# => "Suzuki": {
# => "name":"suzuki",
# => "age":25
# => }
#...

JSON::Generator::GeneratorMethods::String#to_json_raw_object -> Hash (9107.0)

生の文字列を格納したハッシュを生成します。

... 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:...

JSON::Parser#parse -> object (3107.0)

現在のソースをパースして結果を 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
per...
...son.name # => "tanaka"
person.age # => 20

__END__
{
"name":"tanaka",
"age":20
}
//}

@see JSON::Parser#source...

Gem::SpecFetcher#load_specs(source_uri, file) -> object (224.0)

指定された source_uri, file から gemspec をロードします。

...指定された source_uri, file から gemspec をロードします。

また、内部ではキャッシュの更新も行っています。

@param source_uri gemspec の置いてある URI を指定します。

@param file gemspec のファイル名を指定します。...

Gem::SpecFetcher#fetch_spec(spec, source_uri) -> object (208.0)

@todo

...@todo

@param spec
@param source_uri...

絞り込み条件を変える