2711件ヒット
[101-200件を表示]
(0.052秒)
ライブラリ
- ビルトイン (2201)
- csv (3)
- delegate (12)
- digest (12)
- erb (12)
- fiber (8)
- gdbm (24)
-
irb
/ cmd / subirb (12) -
irb
/ extend-command (12) - json (24)
-
minitest
/ spec (1) -
mutex
_ m (12) -
net
/ http (24) -
net
/ pop (108) - pp (24)
- prime (24)
- pstore (36)
- rake (36)
-
rdoc
/ code _ object (12) -
shell
/ filter (6) - socket (12)
- thread (12)
- win32ole (84)
クラス
-
ARGF
. class (96) - Array (84)
- BasicObject (144)
- Binding (24)
-
CSV
:: Row (3) - Class (24)
- Data (3)
- ERB (12)
- Enumerator (120)
-
Enumerator
:: Lazy (48) -
Enumerator
:: Yielder (24) - Fiber (42)
- FrozenError (6)
- GDBM (24)
- Hash (12)
-
IRB
:: ExtendCommand :: Kill (12) -
JSON
:: Parser (12) - KeyError (16)
- LocalJumpError (12)
- Method (80)
- Module (426)
- Mutex (2)
- NameError (34)
-
Net
:: HTTPGenericRequest (24) -
Net
:: POPMail (108) - NoMethodError (12)
- Object (481)
- PStore (36)
- Prime (24)
-
RDoc
:: CodeObject (12) -
Rake
:: TaskArguments (12) - Random (36)
- Range (72)
- Regexp (36)
-
Shell
:: Filter (6) - Socket (12)
- StopIteration (12)
- String (37)
- Thread (12)
-
Thread
:: Mutex (10) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - TracePoint (67)
- UncaughtThrowError (22)
-
WIN32OLE
_ PARAM (12) -
WIN32OLE
_ TYPE (24) -
WIN32OLE
_ VARIABLE (48)
モジュール
- Comparable (12)
- Enumerable (168)
-
IRB
:: ExtendCommandBundle (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (24)
-
Mutex
_ m (12) -
Rake
:: Cloneable (24)
キーワード
- ! (12)
- != (12)
- % (12)
- < (12)
- << (12)
- <= (12)
- <=> (12)
- == (24)
- === (56)
- > (12)
- >= (12)
- DelegateClass (12)
- Digest (12)
- [] (72)
-
_ _ send _ _ (24) -
_ dump (12) - all (36)
- allocate (12)
- ancestors (12)
-
append
_ as _ bytes (1) - args (12)
- at (12)
- begin (12)
-
body
_ stream (12) -
body
_ stream= (12) - call (24)
- clamp (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - clone (24)
-
connect
_ nonblock (12) -
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
- deconstruct (6)
-
def
_ class (12) - default (12)
-
default
_ event _ sources (12) -
define
_ singleton _ method (24) - delete (36)
- deq (24)
- disable (24)
- display (12)
- dup (24)
- each (120)
-
each
_ line (48) - enable (24)
-
enum
_ for (48) - eval (12)
- execute (12)
-
exit
_ value (12) - extend (12)
-
extend
_ object (12) - extended (12)
- feed (12)
- fetch (48)
- first (24)
- freeze (12)
- include (12)
- initialize (12)
-
initialize
_ copy (12) - inspect (24)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
irb
_ exit (12) -
is
_ a? (12) - key (8)
-
kind
_ of? (12) - last (24)
-
local
_ variable _ get (12) - mail (36)
-
marshal
_ dump (12) - match (24)
- max (48)
-
max
_ by (48) -
method
_ missing (12) - methods (12)
- min (48)
-
module
_ eval (24) -
module
_ exec (12) -
mu
_ extended (12) -
must
_ send (1) - name (24)
- next (12)
-
next
_ values (12) -
ole
_ type (12) - parameters (7)
- parse (12)
-
peek
_ values (12) - pop (60)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
private
_ constant (9) -
private
_ instance _ methods (12) - public (48)
-
public
_ constant (9) -
public
_ send (24) - raise (18)
- rand (36)
- receiver (36)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) - replace (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) - result (12)
- resume (12)
-
return
_ value (12) - send (24)
- shift (24)
-
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
sort
_ by (24) -
start
_ doc (12) - superclass (12)
- synchronize (12)
- tag (11)
-
to
_ ary (12) -
to
_ enum (48) -
to
_ hash (12) -
to
_ int (12) -
to
_ json (12) -
to
_ proc (12) -
to
_ regexp (12) -
to
_ s (48) -
to
_ str (12) - transaction (12)
- transfer (12)
- value (23)
- variables (12)
-
with
_ object (24) - yield (12)
- | (6)
検索結果
先頭5件
-
BasicObject
# _ _ send _ _ (name , *args) { . . . . } -> object (9227.0) -
オブジェクトのメソッド name を args を引数にして呼び出し、メソッドの結果を返します。
...')
end
def send(name, *args)
"(Mail#send) - #{name} #{args.join(',')}"
end
end
mail = Mail.new
mail.send :delete, "gentle", "readers" # => "(Mail#send) - delete gentle,readers"
mail.__send__ :delete, "gentle", "readers" # => "(Mail#delete) - delete gentle,readers"
//}
@see Object#... -
Object
# initialize _ copy(obj) -> object (9210.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...elf のインスタンス変数や特異メソッドは変化しません。
デフォルトでは、Object#clone の内部で Object#initialize_clone から、
また Object#dup の内部で Object#initialize_dup から呼ばれます。
initialize_copy は、Ruby インタプリタが知り得......alize_copy でコピーするよう定義しておくことで、dup や clone
を再定義する必要がなくなります。
デフォルトの Object#initialize_copy は、 freeze チェックおよび型のチェックを行い self
を返すだけのメソッドです。
initialize_copy と......Error レシーバが freeze されているか、obj のクラスがレシーバ
のクラスと異なる場合に発生します。
@see Object#clone,Object#dup
以下に例として、dup や clone がこのメソッドをどのように利用しているかを示します。
obj.dup は、... -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (9133.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
...た特異メソッドとは Object#extend によって追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。
singleton_methods(false) は、Object#methods(false) と同じで......vate_class_parent() end
protected; def protected_class_parent() end
public; def public_class_parent() end
end
Foo = Class.new(Parent)
class <<Foo
private; def private_class_foo() end
protected; def protected_class_foo() end
public; def public_class_foo() end
end
module Bar
pri......vate; def private_bar() end
protected; def protected_bar() end
public; def public_bar() end
end
obj = Foo.new
class <<obj
include Bar
private; def private_self() end
protected; def protected_self() end
public; def public_self() end
end
# あるオブジェクトの... -
Object
# instance _ variable _ get(var) -> object | nil (9132.0) -
オブジェクトのインスタンス変数の値を取得して返します。
...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?... -
Object
# marshal _ dump -> object (9132.0) -
Marshal.#dump を制御するメソッドです。
...d の引数に利用できます。
//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def marshal_dump
@foo
end
def marshal_load(obj)
p obj
@foo = obj
end
end
foo = Foo.new(['foo', 'bar'])
p foo #=> #<Foo:0xbaf3b0 @foo=["foo", "bar"]>
dm......定義されていてもマーシャルできるようになります
(特異メソッドの情報が自動的に dump されるようになるわけではなく、
marshal_dump/marshal_load によりそれを実現する余地があるということです)。
@see Object#marshal_load, Marshal... -
Object
# initialize(*args , &block) -> object (9126.0) -
ユーザ定義クラスのオブジェクト初期化メソッド。
...mlist[][ruby]{
class Foo
def initialize name
puts "initialize Foo"
@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:0x2... -
Object
# methods(include _ inherited = true) -> [Symbol] (9121.0) -
そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。
...は Object#singleton_methods(false) と同じになっています。
@param include_inherited 引数が偽の時は Object#singleton_methods(false) と同じになります。
//emlist[例1][ruby]{
class Parent
private; def private_parent() end
protected; def protected_parent() end
pub......def public_parent() end
end
class Foo < Parent
private; def private_foo() end
protected; def protected_foo() end
public; def public_foo() end
end
obj = Foo.new
class <<obj
private; def private_singleton() end
protected; def protected_singleton() end
public; de......f public_singleton() end
end
# あるオブジェクトの応答できるメソッドの一覧を得る。
p obj.methods(false)
p obj.public_methods(false)
p obj.private_methods(false)
p obj.protected_methods(false)
# 実行結果
[:protected_singleton, :public_singleton]
[:public_singleton, :p... -
Object
# clone(freeze: nil) -> object (9115.0) -
オブジェクトの複製を作成して返します。
...freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
obj.taint
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> true
p(obj.tainted?) #=> true
p(obj.frozen?)......_d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
obj.taint
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> true
p(obj.tainted?) #=> false
p(obj.frozen?)......d) #=> true
p(obj_d.tainted?) #=> false
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......ェクトの freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> true
p(obj.frozen?) #=> true
p(obj.respond_to?(:fuga)......obj_d)) #=> false
p(obj == obj_d) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# dup -> object (9115.0) -
オブジェクトの複製を作成して返します。
...freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
obj.taint
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> true
p(obj.tainted?) #=> true
p(obj.frozen?)......_d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
obj.taint
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> true
p(obj.tainted?) #=> false
p(obj.frozen?)......d) #=> true
p(obj_d.tainted?) #=> false
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......ェクトの freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> true
p(obj.frozen?) #=> true
p(obj.respond_to?(:fuga)......obj_d)) #=> false
p(obj == obj_d) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの...