るりまサーチ

最速Rubyリファレンスマニュアル検索!
1834件ヒット [1-100件を表示] (0.146秒)
トップページ > クエリ:t[x] > クエリ:Ruby[x] > クエリ:ruby[x] > クエリ:require[x] > 種類:特異メソッド[x]

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

RubyVM.resolve_feature_path (12185.0)

require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}...

RubyVM::InstructionSequence.compile_option -> Hash (12119.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...//emlist[例][ruby]{
require
"pp"
pp RubyVM::InstructionSequence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>...
...false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

Gem::Requirement.default -> Gem::Requirement (9313.0)

ゼロ以上 ( '>= 0' ) を指定して作成された Gem::Requirement のインスタンスを返します。

...ゼロ以上 ( '>= 0' ) を指定して作成された Gem::Requirement のインスタンスを返します。

//emlist[][ruby]{
pp Gem::Requirement.default
# => Gem::Requirement.new([">= 0"])
//}...

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (9307.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...thod オブジェクトを元に
Ruby
VM::InstructionSequence オブジェクトを作成して返します。

@param body Proc、Method オブジェクトを指定します。

例1:irb で実行した場合

# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <Ruby...
...nstructionSequence:block in irb_binding@(irb)>

# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/iseq_of.rb
def hello
puts...
...{ str = 'a' + 'b' }

# irb
> require '/tmp/iseq_of.rb'

# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>

# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionS...

JSON::State.from_state(options) -> JSON::State (9261.0)

与えられた options によって生成した JSON::State のインスタンスを返します。

...えられた options によって生成した JSON::State のインスタンスを返します。

@param options JSON::State のインスタンスか、ハッシュを指定します。

@return options がハッシュである場合は、それによって初期化した JSON::State を...
...。options が JSON::State のインスタンスである場合は単に
options を返します。いずれでも無い場合は、何も設定されていない JSON::State の
インスタンスを返します。

//emlist[例 Hash を指定][ruby]{
require
"json"

json_state = JS...
...:State.from_state(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}

//emlist[例 JSON::State を指定][ruby]{
require
"json"

json_state = JSON::State.from_state(indent: "\t")
# JSON を出力する何らかの処理を実行する
copy = JSON::State....

絞り込み条件を変える

Gem::Requirement.create(input) -> Gem::Requirement (9213.0)

Gem::Requirement のインスタンスを作成するためのファクトリメソッドです。

...Gem::Requirement のインスタンスを作成するためのファクトリメソッドです。

@param input 文字列か配列か Gem::Requirement, Gem::Version のインスタンス
のいずれかを指定します。

@return 上記以外の値を input に指定するとデフ...
...ォルト値を返します。

//emlist[][ruby]{
pp Gem::Requirement.create("~> 3.2.1")
# => Gem::Requirement.new(["~> 3.2.1"])
//}

@see Gem::Requirement.new, Gem::Requirement.default...

JSON::Generator::GeneratorMethods::String::Extend.json_create(hash) -> String (9139.0)

JSON のオブジェクトから Ruby の文字列を生成して返します。

...JSON のオブジェクトから Ruby の文字列を生成して返します。

@param hash キーとして "raw" という文字列を持ち、その値として数値の配列を持つハッシュを指定します。

require
'json'
String.json_create({"raw" => [0x41, 0x42, 0x43]}) # => "A...

FileUtils.options -> Array (9119.0)

オプション名の配列を返します。

...オプション名の配列を返します。

//emlist[][ruby]{
require
'fileutils'
FileUtils.options
# => ["verbose", "mode", "noop", "parents", "force", "preserve", "dereference_root", "remove_destination", "secure", "mtime", "nocreate"]
//}...
...オプション名の配列を返します。

//emlist[][ruby]{
require
'fileutils'
FileUtils.options
# => ["noop", "verbose", "force", "mode", "parents", "owner", "group", "preserve", "dereference_root", "remove_destination", "secure", "mtime", "nocreate"]
//}...

FileUtils.options_of(mid) -> Array (9119.0)

与えられたメソッド名で使用可能なオプション名の配列を返します。

...与えられたメソッド名で使用可能なオプション名の配列を返します。

@param mid メソッド名を指定します。

//emlist[][ruby]{
require
'fileutils'
FileUtils.options_of(:rm) # => ["noop", "verbose", "force"]
//}...

TSort.strongly_connected_components(each_node, each_child) -> Array (9119.0)

強連結成分の集まりを配列の配列として返します。 この配列は子から親に向かってソートされています。 各要素は強連結成分を表す配列です。

...オブジェクトを指定します。

//emlist[使用例][ruby]{
require
'tsort'

g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
p TSort.strongly_connected_components(each_node, each_child)
# => [[4], [2], [3], [1]]...
...g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
p TSort.strongly_connected_components(each_node, each_child)
# => [[4], [2, 3], [1]]
//}

@see TSort#strongly_connected_components...

絞り込み条件を変える

<< 1 2 3 ... > >>