るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

検索結果

<< 1 2 3 > >>

Method#hash -> Integer (27226.0)

自身のハッシュ値を返します。

...自身のハッシュ値を返します。


//emlist[例][ruby]{
a = method(:==)
b = method(:eql?)
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}...

UnboundMethod#hash -> Integer (21226.0)

自身のハッシュ値を返します。

...自身のハッシュ値を返します。


//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}...

JSON::Generator::GeneratorMethods::Hash#to_json(state_or_hash = nil) -> String (6214.0)

自身から生成した JSON 形式の文字列を返します。

...の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash
指定します。

//emli...

JSON::Generator::GeneratorMethods::String#to_json(state_or_hash = nil) -> String (3226.0)

自身から生成した 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...

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (3220.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

...ためのメソッドです。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash
指定します。

//emli...
...ruby]{
require "json"

class Person
attr :name, :age

def initialize(name, age)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}...

絞り込み条件を変える

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

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

...は UTF-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_j...

JSON::Generator::GeneratorMethods::Array#to_json(state_or_hash = nil) -> String (3214.0)

自身から生成した JSON 形式の文字列を返します。

...の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash
指定します。

//emli...

JSON::Generator::GeneratorMethods::FalseClass#to_json(state_or_hash = nil) -> String (3214.0)

自身から生成した JSON 形式の文字列を返します。

...う文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash
指定します。

//emli...

JSON::Generator::GeneratorMethods::Float#to_json(state_or_hash = nil) -> String (3214.0)

自身から生成した JSON 形式の文字列を返します。

...の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash
指定します。

//emli...
<< 1 2 3 > >>