1163件ヒット
[1-100件を表示]
(0.075秒)
ライブラリ
- ビルトイン (531)
- delegate (12)
- erb (12)
-
fiddle
/ import (12) - forwardable (48)
- json (24)
- logger (1)
- openssl (12)
- psych (12)
-
rdoc
/ context (24) -
rdoc
/ generator / darkfish (12) -
rdoc
/ generator / ri (12) -
rexml
/ document (12) -
rubygems
/ specification (24) -
shell
/ command-processor (6) - sync (6)
- thread (2)
- tracer (24)
-
webrick
/ httpauth / digestauth (12) - win32ole (24)
クラス
- BasicObject (84)
- Class (48)
- Data (6)
- ERB (12)
-
Gem
:: Specification (24) - Object (168)
- Proc (19)
-
RDoc
:: Context (24) -
RDoc
:: Generator :: Darkfish (12) -
RDoc
:: Generator :: RI (12) -
REXML
:: Child (12) -
Shell
:: CommandProcessor (6) - Struct (4)
- Thread (24)
-
Thread
:: Backtrace :: Location (48) - Tracer (24)
- WIN32OLE (12)
-
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (72)
-
Fiddle
:: Importer (12) - Forwardable (48)
- JSON (12)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (12)
- ObjectSpace (36)
キーワード
- ! (12)
- != (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - == (12)
- Application (1)
- BasicObject (12)
- Cipher (12)
- ConditionVariable (12)
- DelegateClass (12)
- DigestAuth (12)
- Location (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Ruby用語集 (12)
-
Sync
_ m (6) - [] (1)
-
_ dump (12) -
absolute
_ path (12) - allocate (12)
-
base
_ label (12) -
cgi
/ session (12) - clone (12)
-
create
_ id (12) -
def
_ class (12) -
def
_ delegator (12) -
def
_ instance _ delegator (12) -
default
_ event _ sources (12) - define (6)
-
define
_ finalizer (24) - delegate (12)
-
drb
/ extservm (12) -
drb
/ gw (12) - dup (12)
- fork (12)
-
from
_ yaml (12) -
initialize
_ classes _ and _ modules (12) -
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) -
initialize
_ methods _ etc (12) - inspect (24)
-
instance
_ delegate (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
irb
/ completion (12) - logger (12)
-
marshal
_ dump (12) - max (48)
-
method
_ missing (12) - min (24)
- new (70)
-
ole
_ activex _ initialize (12) -
rb
_ class _ initialize (12) -
rb
_ mod _ initialize (12) -
rb
_ obj _ call _ init (12) -
rb
_ thread _ initialize (12) - rdoc (12)
-
rdoc
/ generator / json _ index (12) -
rdoc
/ parser (12) -
rexml
/ parsers / streamparser (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
set
_ get _ line _ procs (24) -
singleton
_ method (12) - start (12)
- struct (12)
-
to
_ json (12) -
to
_ s (24) -
undefine
_ finalizer (12) - yaml (12)
-
yaml
_ initialize (12) -
yaml
_ tag (12) - クラス/メソッドの定義 (12)
- セキュリティモデル (12)
- パターンマッチ (12)
- 演算子式 (12)
検索結果
先頭5件
-
Class
# allocate -> object (26106.0) -
自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。
...ェクトは
自身のインスタンスであること以外には何も特性を持ちません。
//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end
def initialized?
@initialized || false
end
end
klass.allocate.initialized? #=> false
//}... -
Class
. new(superclass = Object) -> Class (23230.0) -
新しく名前の付いていない superclass のサブクラスを生成します。
...ていない superclass のサブクラスを生成します。
名前のないクラスは、最初に名前を求める際に代入されている定数名を検
索し、見つかった定数名をクラス名とします。
//emlist[例][ruby]{
p foo = Class.new # => #<Class:0x401b90f8>
p fo......= Class.new(superclass)
klass.module_eval {|m|
# ...
}
klass
//}
この場合も生成したクラスを返します。
ブロックの実行は Class#initialize が行います。
@param superclass 生成するクラスのスーパークラスを指定します。
//emlist[例][ruby]{
k = Cla......ss.new{|c|
def initialize
p "in initialize"
end
def hoge
p "hoge hoge hoge"
end
}
o = k.new #=> "in initialize"
o.hoge #=> "hoge hoge hoge"
//}... -
Class
. new(superclass = Object) {|klass| . . . } -> Class (23230.0) -
新しく名前の付いていない superclass のサブクラスを生成します。
...ていない superclass のサブクラスを生成します。
名前のないクラスは、最初に名前を求める際に代入されている定数名を検
索し、見つかった定数名をクラス名とします。
//emlist[例][ruby]{
p foo = Class.new # => #<Class:0x401b90f8>
p fo......= Class.new(superclass)
klass.module_eval {|m|
# ...
}
klass
//}
この場合も生成したクラスを返します。
ブロックの実行は Class#initialize が行います。
@param superclass 生成するクラスのスーパークラスを指定します。
//emlist[例][ruby]{
k = Cla......ss.new{|c|
def initialize
p "in initialize"
end
def hoge
p "hoge hoge hoge"
end
}
o = k.new #=> "in initialize"
o.hoge #=> "hoge hoge hoge"
//}... -
Class
# new(*args , &block) -> object (23182.0) -
自身のインスタンスを生成して返します。 このメソッドの引数はブロック引数も含め Object#initialize に渡されます。
...ク引数も含め Object#initialize に渡されます。
new は Class#allocate でインスタンスを生成し、
Object#initialize で初期化を行います。
@param args Object#initialize に渡される引数を指定します。
@param block Object#initialize に渡されるブロッ......クを指定します。
//emlist[例][ruby]{
# Class クラスのインスタンス、C クラスを生成
C = Class.new # => C
# Class クラスのインスタンス、C クラスのインスタンスを生成
C.new # => #<C:0x00005623f8b4e458>
//}... -
Object
# initialize(*args , &block) -> object (21249.0) -
ユーザ定義クラスのオブジェクト初期化メソッド。
...ド。
このメソッドは Class#new から新しく生成されたオブ
ジェクトの初期化のために呼び出されます。他の言語のコンストラクタに相当します。
デフォルトの動作ではなにもしません。
initialize には
Class#new に与えられた引......。
initialize という名前のメソッドは自動的に private に設定され
ます。
@param args 初期化時の引数です。
@param block 初期化時のブロック引数です。必須ではありません。
//emlist[][ruby]{
class Foo
def initialize name
puts "initialize Fo......o"
@name = name
end
end
class Bar < Foo
def initialize name, pass
puts "initialize Bar"
super name
@pass = pass
end
end
it = Bar.new('myname','0500')
p it
#=> initialize Bar
# initialize Foo
# #<Bar:0x2b68f08 @name="myname", @pass="0500">
//}
@see Class#new... -
RDoc
:: Generator :: Darkfish # initialize(store , options) -> RDoc :: Generator :: Darkfish (21229.0) -
RDoc::Generator::Darkfish オブジェクトを初期化します。
...RDoc::Generator::Darkfish オブジェクトを初期化します。
@param store RDoc::Store オブジェクトを指定します。
@param options RDoc::Options オブジェクトを指定します。... -
RDoc
:: Generator :: RI # initialize(store , options) -> RDoc :: Generator :: RI (21229.0) -
RDoc::Generator::RI オブジェクトを初期化します。
...RDoc::Generator::RI オブジェクトを初期化します。
@param store RDoc::Store オブジェクトを指定します。
@param options RDoc::Options オブジェクトを指定します。... -
Shell
:: CommandProcessor . initialize -> () (21101.0) -
@todo
@todo
このクラスを初期化します。 -
Object
# initialize _ copy(obj) -> object (12297.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...では、Object#clone の内部で Object#initialize_clone から、
また Object#dup の内部で Object#initialize_dup から呼ばれます。
initialize_copy は、Ruby インタプリタが知り得ない情報をコピーするた
めに使用(定義)されます。例えば C 言語でク...... initialize_copy でコピーするよう定義しておくことで、dup や clone
を再定義する必要がなくなります。
デフォルトの Object#initialize_copy は、 freeze チェックおよび型のチェックを行い self
を返すだけのメソッドです。
initialize_cop......Object#clone,Object#dup
以下に例として、dup や clone がこのメソッドをどのように利用しているかを示します。
obj.dup は、新たに生成したオブジェクトに対して
initialize_copy を呼び
//emlist[][ruby]{
obj2 = obj.class.allocate
obj2.initialize_copy...