るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

検索結果

Delegator#methods -> [Symbol] (63325.0)

そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。

そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。
このメソッドは public メソッドおよび protected メソッドの名前を返します。

@see Object#methods

JSON::Generator::GeneratorMethods::String#to_json_raw -> String (45439.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

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

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

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

このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。

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

//emlist[例][ruby...

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

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

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

自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。

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

//emlist[例][ruby]...

JSON::Generator::GeneratorMethods::String#to_json_raw_object -> Hash (45343.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_json # source sequence is illegal/malformed (JSON::...

絞り込み条件を変える

JSON::Generator::GeneratorMethods::Array#to_json(state_or_hash = nil) -> String (45325.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::FalseClass#to_json(state_or_hash = nil) -> String (45325.0)

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

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

"false" という文字列を返します。

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

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

false.to_json # => "false"
//}

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

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

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

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

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

(1.0).to_json # => "1.0"
//}

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

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

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

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

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

person = { "name" => "tanaka", "age" => 19 }
person.to_json # ...

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

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

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

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

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

10.to_json # => "10"
//}

絞り込み条件を変える

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

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

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

"null" という文字列を返します。

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

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

nil.to_json # => "null"
//}

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

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

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

"true" という文字列を返します。

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

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

true.to_json # => "true"
//}

Object#singleton_methods(inherited_too = true) -> [Symbol] (37069.0)

そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。

そのオブジェクトに対して定義されている特異メソッド名
(public あるいは protected メソッド) の一覧を返します。

inherited_too が真のときは継承した特異メソッドを含みます。
継承した特異メソッドとは Object#extend によって追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。

singleton_methods(false) は、Object#methods(false) と同じです。

@param inherited_too 継承した特異メソッドを含める場合は...

Delegator#protected_methods(all = true) -> [Symbol] (27325.0)

そのオブジェクトが理解できる protected メソッド名の一覧を返します。

そのオブジェクトが理解できる protected メソッド名の一覧を返します。

@param all 偽を指定すると __getobj__ のスーパークラスで定義されたメソッドを除きます。

@see Object#protected_methods

Delegator#public_methods(all = true) -> [Symbol] (27325.0)

そのオブジェクトが理解できる public メソッド名の一覧を返します。

そのオブジェクトが理解できる public メソッド名の一覧を返します。

@param all 偽を指定すると __getobj__ のスーパークラスで定義されたメソッドを除きます。

@see Object#public_methods

絞り込み条件を変える

Module#instance_methods(inherited_too = true) -> [Symbol] (18841.0)

そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。

そのモジュールで定義されている public および protected メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。

@see Object#methods

//emlist[例1][ruby]{
class Foo
private; def private_foo() end
protected; def protected_foo() end
public; def public_foo() end
end

# あるクラスのインスタンス...

Module#private_instance_methods(inherited_too = true) -> [Symbol] (18679.0)

そのモジュールで定義されている private メソッド名 の一覧を配列で返します。

そのモジュールで定義されている private メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。

@see Object#private_methods, Module#instance_methods

//emlist[例][ruby]{
module Foo
def foo; end
private def bar; end
end

module Bar
include Foo

def baz; end
private def qux; end
end...

Forwardable#def_delegators(accessor, *methods) -> () (18646.0)

メソッドの委譲先をまとめて設定します。

メソッドの委譲先をまとめて設定します。

@param accessor 委譲先のオブジェクト

@param methods 委譲するメソッドのリスト

委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。

def_delegators は def_instance_delegators の別名になります。

また、以下の 2 つの例は同じ意味です。

def_delegators :@records, :size, :<<, :map

def_delegator :@reco...

Forwardable#def_instance_delegators(accessor, *methods) -> () (18646.0)

メソッドの委譲先をまとめて設定します。

メソッドの委譲先をまとめて設定します。

@param accessor 委譲先のオブジェクト

@param methods 委譲するメソッドのリスト

委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。

def_delegators は def_instance_delegators の別名になります。

また、以下の 2 つの例は同じ意味です。

def_delegators :@records, :size, :<<, :map

def_delegator :@reco...

SingleForwardable#def_delegators(accessor, *methods) -> () (18646.0)

メソッドの委譲先をまとめて設定します。

メソッドの委譲先をまとめて設定します。

@param accessor 委譲先のオブジェクト

@param methods 委譲するメソッドのリスト

委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。

def_delegators は def_singleton_delegators の別名になります。

また、以下の 2 つの例は同じ意味です。

def_delegators :@records, :size, :<<, :map

def_delegator :@rec...

絞り込み条件を変える

SingleForwardable#def_single_delegators(accessor, *methods) -> () (18646.0)

メソッドの委譲先をまとめて設定します。

メソッドの委譲先をまとめて設定します。

@param accessor 委譲先のオブジェクト

@param methods 委譲するメソッドのリスト

委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。

def_delegators は def_singleton_delegators の別名になります。

また、以下の 2 つの例は同じ意味です。

def_delegators :@records, :size, :<<, :map

def_delegator :@rec...

Module#protected_instance_methods(inherited_too = true) -> [Symbol] (18643.0)

そのモジュールで定義されている protected メソッド名 の一覧を配列で返します。

そのモジュールで定義されている protected メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。


@see Object#protected_methods, Module#instance_methods

Module#public_instance_methods(inherited_too = true) -> [Symbol] (18643.0)

そのモジュールで定義されている public メソッド名 の一覧を配列で返します。

そのモジュールで定義されている public メソッド名
の一覧を配列で返します。

@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。


@see Object#public_methods, Module#instance_methods

RDoc::Context#set_visibility_for(methods, visibility, singleton = false) -> () (673.0)

methods で指定した RDoc::AnyMethod、RDoc::Attr の内、 singleton で指定した条件と一致するメソッドすべての可視性を visibility に設定します。

methods で指定した RDoc::AnyMethod、RDoc::Attr の内、
singleton で指定した条件と一致するメソッドすべての可視性を visibility
に設定します。

@param methods RDoc::AnyMethod、RDoc::Attr オブジェクトの配
列を指定します。

@param visibility 可視性を :public, :protected, :private の内のいずれか
で指定します。

@param singleton 特異メソッドの可視性を変更する場合は...

Module#ruby2_keywords(method_name, ...) -> nil (268.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument...

絞り込み条件を変える

Proc#ruby2_keywords -> proc (202.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked ...