228件ヒット
[1-100件を表示]
(0.032秒)
種類
- インスタンスメソッド (132)
- 特異メソッド (36)
- クラス (24)
- 文書 (24)
- ライブラリ (12)
ライブラリ
- ビルトイン (130)
- erb (12)
- json (24)
-
rdoc
/ generator / ri (12) - thread (2)
-
webrick
/ httpauth / digestauth (12)
クラス
- ERB (12)
- File (12)
- Object (60)
-
RDoc
:: Generator :: RI (12) -
Thread
:: Backtrace :: Location (48)
モジュール
キーワード
- ConditionVariable (12)
- DigestAuth (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
_ dump (12) -
absolute
_ path (12) -
base
_ label (12) -
create
_ id (12) - inspect (24)
-
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) - new (12)
- path (12)
- rdoc (12)
-
ruby 1
. 9 feature (12) -
to
_ json (12) -
to
_ s (24)
検索結果
先頭5件
-
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>'
//}...