るりまサーチ (Ruby 3.2)

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

別のキーワード

  1. win32ole ole_activex_initialize
  2. ri initialize
  3. object initialize
  4. darkfish initialize
  5. _builtin initialize

キーワード

検索結果

Thread::Backtrace::Location (40.0)

Ruby のフレームを表すクラスです。

...例1の実行結果:

caller_locations.rb:2:in `a'
caller_locations.rb:5:in `b'
caller_locations.rb:8:in `c'

//emlist[例2][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|
p...

BasicObject (22.0)

特殊な用途のために意図的にほとんど何も定義されていないクラスです。 Objectクラスの親にあたります。Ruby 1.9 以降で導入されました。

...クラスから派生すべきです。
真に必要な場合にだけ BasicObject から派生してください。

=== 例

//emlist[例][ruby]{
class
Proxy < BasicObject
def initialize(target)
@target = target
end

def method_missing(message, *args)
@target.__send__(message, *args...

OpenSSL::Cipher (22.0)

共通鍵暗号のために抽象化されたインターフェースを提供するクラスです。

共通鍵暗号のために抽象化されたインターフェースを提供するクラスです。

基本的にこのクラスを直接使ってデータを暗号化することは
避けてください。通常はより高水準なインターフェースが利用可能な
はずです。必要なのは暗号アルゴリズムを指定するため
OpenSSL::Cipher.new で暗号オブジェクトを生成することだけでしょう。

もし、このクラスを直接利用して暗号化する場合は、暗号の鍵や
IV(Initialization Vector)の取り扱いについて正しく理解してからに
してください。

以下の手順で利用します。
* OpenSSL::Cipher.new や OpenSSL::...

OpenSSL::PKey::RSA (22.0)

RSA 暗号鍵のクラスです。

RSA 暗号鍵のクラスです。

通常このクラスで利用するのは、
OpenSSL::PKey::RSA.generate, OpenSSL::PKey::RSA.new,
OpenSSL::PKey::RSA#public?, OpenSSL::PKey::RSA#private?,
OpenSSL::PKey::RSA#public_key, OpenSSL::PKey::RSA#to_text,
OpenSSL::PKey::RSA#to_pem, OpenSSL::PKey::RSA#to_der
のいずれかでしょう。これ以外のメソッドを利用するときは
RSA についてよく理解し、必要な場...

RegexpError (22.0)

正規表現のコンパイルに失敗したときに発生します。

正規表現のコンパイルに失敗したときに発生します。

例:

$ ruby -e 'Regexp.compile("*")'
-e:1:in `initialize': target of repeat operator is not specified: /*/ (RegexpError)
from -e:1:in `Regexp#compile'
from -e:1

絞り込み条件を変える

Thread::ConditionVariable (22.0)

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

...が空になった場合、
あるいは満タンになった場合に Condition Variable を使って wait しています。

require 'thread'

class
TinyQueue
def initialize(max=2)
@max = max
@full = ConditionVariable.new
@empty = ConditionVariable.new
@mutex = Mut...

WEBrick::HTTPAuth::DigestAuth (22.0)

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

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

2617 も参照してください。

例:
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

dige...