るりまサーチ

最速Rubyリファレンスマニュアル検索!
228件ヒット [1-100件を表示] (0.032秒)
トップページ > クエリ:ri[x] > クエリ:initialize[x]

別のキーワード

  1. ri generate
  2. ri description
  3. rdoc/generator/ri initialize
  4. rdoc/generator/ri ri

検索結果

<< 1 2 3 > >>

RDoc::Generator::RI#initialize(store, options) -> RDoc::Generator::RI (21218.0)

RDoc::Generator::RI オブジェクトを初期化します。

...RDoc::Generator::RI オブジェクトを初期化します。

@param store RDoc::Store オブジェクトを指定します。

@param options RDoc::Options オブジェクトを指定します。...

Object#instance_variable_defined?(var) -> bool (6106.0)

インスタンス変数 var が定義されていたら真を返します。

...def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true
p fred.instance_variable_defined?("@b") #=> true
p fred.instance_variable_defined?("@c") #=> false
//}

@see Object#instance_variable_get,Object#instance_variable_...
...set,Object#instance_variables...

Object#instance_variable_get(var) -> object | nil (6106.0)

オブジェクトのインスタンス変数の値を取得して返します。

...ass Foo
def initialize
@foo = 1
end
end

obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variable_get(:@bar) #=> nil
//}

@see Object#instance_variable_set,Object#instance_variables,Object#instance_variable_defined...

Thread::ConditionVariable (6006.0)

スレッドの同期機構の一つである状態変数を実現するクラスです。

...つである状態変数を実現するクラスです。

以下も ConditionVariable を理解するのに参考になります。

https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF

=== Condition Variable とは

あるスレッド A が排他領域で動いていたとします...
...ースの空きを
待っていても、いつまでも空くことはありません。

以上のような状況を解決するのが Condition Variable です。

スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを止め...
...あるいは満タンになった場合に Condition Variable を使って wait しています。

require 'thread'

class TinyQueue
def initialize(max=2)
@max = max
@full = ConditionVariable.new
@empty = ConditionVariable.new
@mutex = Mutex.new
@q = []
end...

WEBrick::HTTPAuth::DigestAuth (3006.0)

HTTP の Digest 認証のためのクラスです。

...

例:
require 'webrick'
config = { :Realm => 'DigestAuth example realm' }

htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
htdigest.set_passwd config[:Realm], 'username', 'password'
htdigest.flush

config[:UserDB] = htdigest

digest_auth = WEBrick::HTTPAuth::DigestAut...
...fig

サーブレットの initialize メソッドの中でこのクラスのインスタンスを作成
しないようにしてください。デフォルトでは WEBrick はリクエストのたびにサー
ブレットのインスタンスを生成しますが、
WEBrick::HTTPAuth::DigestAuth...

絞り込み条件を変える

ERB.new(str, safe_level=NOT_GIVEN, trim_mode=NOT_GIVEN, eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: &#39;_erbout&#39;) -> ERB (206.0)

eRubyスクリプト から ERB オブジェクトを生成して返します。

...

@param str eRubyスクリプトを表す文字列
@param safe_level eRubyスクリプトが実行されるときのセーフレベル
@param trim_mode 整形の挙動を変更するオプション

@param eoutvar eRubyスクリプトの中で出力をためていく変数の名前を表す文...
...fe_level, trim_mode, eoutvar の指定は非推奨です。
Ruby 3.2 で削除されました。
trim_mode と eoutvar の指定はキーワード引数に移行してください。

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

# build data class
class Listings
PRODUCT = { :name => "Chicken Fried Steak",...
...ages pattie, breaded and fried.",
:cost => 9.95 }

attr_reader :product, :price

def initialize( product = "", price = "" )
@product = product
@price = price
end

def build
b = binding
# create and run templates, filling member data variables
ERB.new(<<~'END...

Thread::Backtrace::Location#base_label -> String (112.0)

self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。

...されます。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.base_label
end

# => initialize
# new
# <main>
//}

@see Thread::Backtrace::Location#label...

Thread::Backtrace::Location#inspect -> String (112.0)

Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。

...st[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.inspect
end

# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `<main>'"...

Thread::Backtrace::Location#to_s -> String (112.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...mlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end

# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}...
<< 1 2 3 > >>