11481件ヒット
[1-100件を表示]
(0.112秒)
種類
ライブラリ
- ビルトイン (5837)
- bigdecimal (36)
- continuation (12)
- coverage (8)
- csv (132)
- date (12)
- debug (12)
- delegate (180)
- digest (24)
- drb (12)
-
drb
/ extserv (12) - e2mmap (6)
- erb (12)
- etc (24)
- fiber (8)
- fiddle (48)
- forwardable (12)
- gdbm (60)
-
io
/ console (12) - ipaddr (24)
-
irb
/ cmd / subirb (12) -
irb
/ context (48) -
irb
/ ext / save-history (12) -
irb
/ extend-command (72) -
irb
/ frame (12) -
irb
/ inspector (12) -
irb
/ magic-file (24) - json (336)
- matrix (24)
-
minitest
/ spec (11) -
minitest
/ unit (9) - mkmf (60)
-
net
/ ftp (24) -
net
/ http (72) -
net
/ imap (48) -
net
/ pop (156) -
net
/ smtp (76) - objspace (132)
- observer (12)
- open-uri (32)
- openssl (336)
- optparse (192)
- ostruct (43)
- pathname (24)
- pp (52)
- prettyprint (24)
- prime (120)
- profiler (6)
- pstore (48)
- psych (206)
- pty (12)
- rake (48)
-
rdoc
/ code _ object (120) -
rdoc
/ known _ classes (12) -
rdoc
/ markup (12) - resolv (24)
-
rexml
/ document (168) -
rexml
/ parsers / pullparser (24) -
rinda
/ rinda (36) -
rinda
/ tuplespace (12) -
ripper
/ filter (36) -
ripper
/ sexp (24) - rubygems (12)
-
rubygems
/ config _ file (12) -
rubygems
/ spec _ fetcher (12) -
rubygems
/ specification (24) - sdbm (36)
- shell (24)
-
shell
/ command-processor (6) -
shell
/ filter (6) -
shell
/ process-controller (6) - singleton (24)
- socket (312)
- strscan (48)
- tempfile (60)
-
test
/ unit (1) - thread (12)
- timeout (29)
- tracer (24)
- uri (24)
- weakref (24)
-
webrick
/ httpauth / authenticator (12) -
webrick
/ httpauth / basicauth (12) - win32ole (600)
-
yaml
/ dbm (156) - zlib (96)
クラス
-
ARGF
. class (192) - Addrinfo (120)
- Array (806)
- BasicObject (168)
- BigDecimal (36)
- Binding (24)
- CSV (72)
-
CSV
:: Row (36) -
CSV
:: Table (12) - Class (72)
- Complex (12)
- Coverage (8)
-
DRb
:: DRbUnknown (12) -
DRb
:: ExtServ (12) - Data (12)
- Date (12)
- Delegator (120)
-
Digest
:: Base (12) - Dir (108)
- ERB (12)
- Enumerator (156)
-
Enumerator
:: Chain (21) -
Enumerator
:: Lazy (60) -
Enumerator
:: Yielder (24) - Fiber (54)
-
Fiddle
:: Closure :: BlockCaller (12) -
Fiddle
:: Pointer (12) - File (36)
- GDBM (60)
-
Gem
:: ConfigFile (12) -
Gem
:: SpecFetcher (12) -
Gem
:: Specification (24) - Hash (313)
- IO (276)
- IPAddr (24)
-
IRB
:: Context (48) -
IRB
:: ExtendCommand :: Kill (12) -
IRB
:: Frame (12) -
IRB
:: Inspector (12) - Integer (24)
-
JSON
:: Parser (24) -
JSON
:: State (84) - LocalJumpError (12)
- MatchData (12)
- Matrix (24)
- Method (68)
- Module (374)
- NameError (34)
-
Net
:: FTP (24) -
Net
:: HTTP (48) -
Net
:: HTTPGenericRequest (24) -
Net
:: IMAP (12) -
Net
:: IMAP :: FetchData (12) -
Net
:: IMAP :: ResponseCode (12) -
Net
:: IMAP :: UntaggedResponse (12) -
Net
:: POP3 (48) -
Net
:: POPMail (108) -
Net
:: SMTP (76) - NoMethodError (12)
- Object (764)
-
ObjectSpace
:: WeakMap (24) -
OpenSSL
:: ASN1 :: ASN1Data (12) -
OpenSSL
:: ASN1 :: ObjectId (96) -
OpenSSL
:: SSL :: SSLContext (12) -
OpenSSL
:: X509 :: Attribute (48) -
OpenSSL
:: X509 :: Name (108) - OpenStruct (43)
- OptionParser (144)
-
OptionParser
:: ParseError (12) - PP (36)
- PStore (48)
- Pathname (24)
- PrettyPrint (24)
- Prime (48)
-
Prime
:: PseudoPrimeGenerator (48) - Proc (31)
-
Psych
:: Nodes :: Node (12) -
Psych
:: ScalarScanner (12) -
Psych
:: Visitors :: YAMLTree (24) -
RDoc
:: CodeObject (120) -
RDoc
:: Markup (12) -
REXML
:: Attribute (12) -
REXML
:: Elements (24) -
REXML
:: Parent (132) -
REXML
:: Parsers :: PullEvent (24) -
Rake
:: TaskArguments (24) - Random (36)
- Range (200)
- Rational (12)
- Regexp (36)
-
Resolv
:: DNS (24) -
Rinda
:: DRbObjectTemplate (24) -
Rinda
:: TupleEntry (12) - Ripper (24)
-
Ripper
:: Filter (36) -
RubyVM
:: InstructionSequence (12) - SDBM (36)
- Shell (24)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) -
Shell
:: ProcessController (6) - SimpleDelegator (36)
- Socket (84)
- StopIteration (12)
- String (45)
- StringScanner (48)
- Struct (102)
- Tempfile (60)
- Thread (80)
-
Thread
:: Mutex (10) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - Time (12)
- TracePoint (90)
- Tracer (36)
- UNIXServer (48)
- UNIXSocket (60)
- UnboundMethod (24)
- UncaughtThrowError (22)
-
WEBrick
:: HTTPAuth :: BasicAuth (12) - WIN32OLE (72)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ METHOD (84) -
WIN32OLE
_ PARAM (84) -
WIN32OLE
_ TYPE (96) -
WIN32OLE
_ TYPELIB (108) -
WIN32OLE
_ VARIABLE (84) -
WIN32OLE
_ VARIANT (36) - WeakRef (12)
-
YAML
:: DBM (156) -
Zlib
:: GzipReader (48) -
Zlib
:: GzipWriter (48)
モジュール
- Comparable (15)
- Enumerable (780)
- Etc (24)
- Exception2MessageMapper (6)
- Fiddle (24)
- GC (26)
-
GC
:: Profiler (12) - Gem (12)
-
IRB
:: ContextExtender (24) -
IRB
:: ExtendCommandBundle (48) -
IRB
:: HistorySavingAbility (12) - JSON (168)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (24) - Kernel (428)
- Marshal (72)
-
MiniTest
:: Assertions (9) - ObjectSpace (252)
- Observable (12)
-
OpenSSL
:: ASN1 (48) -
OptionParser
:: Arguable (24) - PTY (12)
-
Profiler
_ _ (6) - Psych (114)
- RDoc (12)
-
Rake
:: Cloneable (24) - Singleton (12)
-
Test
:: Unit (1) - Timeout (21)
- URI (40)
-
WEBrick
:: HTTPAuth :: Authenticator (12)
オブジェクト
-
IRB
:: MagicFile (24) - main (36)
キーワード
- ! (12)
- != (12)
-
$ FILENAME (12) -
$ SAFE (5) - % (12)
- & (12)
- - (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (48)
- <=> (24)
- == (27)
- === (32)
- ARGF (24)
- ARGV (24)
- Arguable (12)
- Array (12)
-
BUILD
_ RUBY _ PLATFORM (12) - BasicObject (12)
- CSV (12)
- Class (12)
- Converters (12)
- DATA (12)
-
DEFAULT
_ OBJECT _ TYPE (12) -
DEFAULT
_ PARAMS (12) - DRbObjectTemplate (12)
- Data (9)
- DelegateClass (12)
- Digest (12)
- Enumerator (12)
- FALSE (8)
- Float (12)
- Forwardable (12)
- Hash (12)
- HeaderConverters (12)
- Id (12)
- Integer (12)
-
KNOWN
_ CLASSES (12) -
MAJOR
_ VERSION (12) -
MINOR
_ VERSION (12) - Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - NIL (8)
- NameError (12)
- NoMethodError (12)
- OBJECT (12)
-
OBJECT
_ DESCRIPTOR (12) -
OBJECT
_ TYPE _ TEMPLATE (12) - ObjectId (36)
- ObjectSpace (12)
- Options (12)
- ROBJECT (12)
-
RUBY
_ PATCHLEVEL (12) -
RUBY
_ PLATFORM (12) -
RUBY
_ RELEASE _ DATE (12) - Rational (12)
- Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Rubyの起動 (12)
- Ruby用語集 (12)
-
SCRIPT
_ LINES _ _ (12) -
SC
_ SHARED _ MEMORY _ OBJECTS (12) -
SC
_ TYPED _ MEMORY _ OBJECTS (12) - SimpleDelegator (12)
- Singleton (12)
- String (12)
- TRUE (8)
- Thread (12)
- Version (12)
-
WIN32OLE
_ PARAM (12) -
WIN32OLE
_ VARIABLE (12) - WeakMap (12)
- WeakRef (12)
- [] (204)
- []= (48)
-
_ _ getobj _ _ (36) -
_ _ id _ _ (12) -
_ _ send _ _ (24) -
_ _ setobj _ _ (24) -
_ dump (12) -
_ getproperty (12) -
_ id2ref (12) -
_ invoke (12) -
_ load (12) - add (12)
-
add
_ entry (12) - all (36)
- allocate (12)
-
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) - ancestors (12)
-
arg
_ config (12) - args (12)
- argv (12)
-
array
_ attributes (12) -
assert
_ empty (1) -
assert
_ equal (1) -
assert
_ includes (1) -
assert
_ instance _ of (1) -
assert
_ kind _ of (1) -
assert
_ nil (1) -
assert
_ respond _ to (1) -
assert
_ same (1) - at (12)
- attr (12)
- begin (12)
- bind (24)
-
bind
_ call (12) - binding (12)
-
body
_ stream (12) -
body
_ stream= (12) -
boot
_ defclass (12) - bsearch (48)
- call (36)
- callcc (12)
- catch (24)
- chdir (36)
- clamp (27)
- class (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - clone (36)
-
cofactor
_ expansion (12) - collect (60)
-
compare
_ by _ identity (12) - connect (24)
-
connect
_ from (24) -
connect
_ nonblock (12) -
connect
_ to (24) -
const
_ defined? (12) -
const
_ get (12) -
const
_ load (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (24)
- convert (12)
-
convertible
_ int (24) -
count
_ nodes (12) -
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) - coverage (8)
- create (24)
-
create
_ id (12) - cycle (24)
- data (24)
- deconstruct (9)
-
def
_ class (12) -
def
_ extend _ command (24) -
def
_ inspector (12) - default (36)
-
default
_ event _ sources (12) -
default
_ ole _ types (12) -
default
_ value (12) -
define
_ finalizer (24) -
define
_ method (24) -
define
_ singleton _ method (24) - delete (132)
-
delete
_ at (12) -
delete
_ field (12) -
delete
_ if (24) -
delete
_ observer (12) -
deprecate
_ constant (12) - deq (24)
- detect (24)
- difference (7)
- dig (30)
- disable (24)
- display (12)
- dlunwrap (12)
-
document
_ children= (12) -
document
_ self= (12) - drb (12)
- dump (48)
-
dump
_ stream (12) - dup (36)
- each (206)
-
each
_ active _ object (6) -
each
_ byte (24) -
each
_ char (24) -
each
_ child (24) -
each
_ line (48) -
each
_ object (48) -
each
_ prime (24) -
each
_ with _ object (24) - enable (24)
- end (12)
- entries (12)
-
enum
_ for (48) - eql? (27)
- equal? (36)
- eval (48)
- evaluate (12)
-
event
_ interface (12) - exclusive (12)
- execute (12)
-
exit
_ value (12) - extend (12)
-
extend
_ object (18) - extended (12)
-
fast
_ generate (12) -
fast
_ unparse (12) - feed (12)
- fetch (140)
-
fetch
_ values (20) - field (12)
- file (12)
- fill (72)
- filter (42)
-
filter
_ map (12) - find (24)
-
find
_ all (24) - first (72)
- force (12)
- format (24)
- freeze (24)
-
garbage
_ collect (12) - generate (36)
- getbyte (12)
- getc (12)
-
global
_ variables (12) - grep (24)
-
grep
_ v (24) -
handle
_ interrupt (12) - handler (12)
- hash (51)
- include (12)
- index (7)
- initialize (12)
-
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) - inject (48)
- input? (12)
- inspect (18)
-
install
_ extend _ commands (24) - instance (36)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) - intersection (6)
- invert (12)
- invoke (12)
- irb (12)
-
irb
/ completion (12) -
irb
/ ext / math-mode (4) -
irb
_ exit (12) -
is
_ a? (12) - join (12)
- key (12)
- keys (12)
-
kind
_ of? (12) - lambda (13)
-
laplace
_ expansion (12) - last (48)
-
last
_ value (12) -
latest
_ gc _ info (24) -
library
_ name (12) - listen (24)
- ln (12)
- load (39)
-
load
_ documents (8) -
load
_ file (36) -
load
_ file! (12) -
load
_ specs (12) -
load
_ stream (24) -
local
_ variable _ get (12) -
local
_ variables (12) - logger (24)
-
long
_ name (12) - lookup (12)
- loop (12)
- mail (36)
- main (24)
-
major
_ version (24) - map (48)
-
marshal
_ dump (24) -
marshal
_ load (24) - match (48)
- max (130)
-
max
_ by (48) -
memsize
_ of (12) -
memsize
_ of _ all (12) - method (12)
-
method
_ missing (36) - methods (12)
- min (130)
-
min
_ by (48) - minmax (48)
-
minmax
_ by (24) - modifiable (12)
-
module
_ eval (24) -
module
_ exec (12) -
mu
_ pp (1) -
must
_ be _ close _ to (1) -
must
_ be _ instance _ of (1) -
must
_ be _ kind _ of (1) -
must
_ be _ same _ as (1) -
must
_ be _ within _ delta (1) -
must
_ be _ within _ epsilon (1) -
must
_ equal (1) -
must
_ match (1) -
must
_ raise (1) -
must
_ respond _ to (1) -
must
_ throw (1) - name (72)
-
net
/ smtp (12) - new (355)
- next (12)
-
next
_ values (12) -
object
_ nl (12) -
object
_ nl= (12) - oid (24)
- oid= (12)
-
ole
_ classes (24) -
ole
_ type (24) -
ole
_ type _ detail (12) -
ole
_ types (12) - on (144)
-
on
_ XXX (12) -
on
_ default (12) - open (404)
- optional? (12)
- p (12)
- parameters (43)
- params (12)
- parent (12)
- parent= (12)
-
parent
_ file _ name (12) -
parent
_ name (12) - parse (60)
- parse! (12)
-
parse
_ openssl (12) -
parse
_ rfc2253 (12) - partition (24)
- path (12)
- peek (12)
-
peek
_ values (12) -
pending
_ interrupt? (12) - pipe (96)
- pop (84)
- popen (120)
- pp (24)
-
pretty
_ generate (12) -
pretty
_ print _ instance _ variables (12) -
pretty
_ unparse (12) -
private
_ constant (9) -
private
_ instance _ methods (12) -
private
_ methods (12) - proc (14)
-
protected
_ instance _ methods (12) -
protected
_ methods (12) -
psych
_ to _ yaml (12) -
psych
_ yaml _ as (4) - public (36)
-
public
_ constant (9) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
public
_ method (12) -
public
_ methods (12) -
public
_ send (24) - push (24)
- pushd (6)
- pushdir (6)
- putc (24)
- raise (18)
- rand (36)
- raw (12)
-
rb
_ any _ to _ s (12) -
rb
_ class _ real (12) -
rb
_ data _ object _ alloc (12) -
rb
_ define _ class _ under (12) -
rb
_ define _ global _ const (12) -
rb
_ extend _ object (12) -
rb
_ false (12) -
rb
_ mod _ extend _ object (12) -
rb
_ obj _ class (12) -
rb
_ obj _ clone (12) -
rb
_ obj _ dup (12) -
rb
_ obj _ freeze (12) -
rb
_ obj _ frozen _ p (12) -
rb
_ obj _ id (12) -
rb
_ obj _ inspect (12) -
rb
_ obj _ methods (12) -
rb
_ obj _ private _ methods (12) -
rb
_ obj _ protected _ methods (12) -
rb
_ obj _ singleton _ methods (12) -
rb
_ obj _ taint (12) -
rb
_ obj _ tainted (12) -
rb
_ obj _ untaint (12) -
rcptto
_ list (12) - rdoc (12)
-
reachable
_ objects _ from (12) -
read
_ nonblock (12) - readline (12)
- receiver (10)
-
recv
_ io (12) - reduce (36)
- register (12)
- rehash (12)
- reject (60)
- reload (12)
-
remove
_ class _ variable (12) -
remove
_ classes _ and _ modules (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) - replace (12)
-
require
_ relative (12) -
respond
_ to? (24) -
respond
_ to _ missing? (12) - responses (12)
- restore (24)
- result (24)
- resume (12)
-
return
_ type _ detail (12) -
return
_ value (12) - rewind (7)
-
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) -
safe
_ load (19) - sample (48)
-
save
_ exception _ mode (12) -
save
_ limit (12) -
save
_ rounding _ mode (12) -
scan
_ full (12) -
search
_ full (12) - section= (12)
- select (96)
- self (12)
- send (24)
- sender (12)
-
set
_ last _ value (12) -
setup
_ argv (1) - sexp (12)
-
sexp
_ raw (12) -
sharing
_ detection (12) -
sharing
_ detection= (12) - shift (72)
-
short
_ name (12) -
singleline
_ format (12) -
singleton
_ class (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
size
_ opt _ params (12) -
size
_ params (12) - slice (36)
- slice! (36)
- sn (12)
- sort (24)
-
sort
_ by (24) - sprintf (12)
- sprintf フォーマット (12)
- start (168)
-
start
_ doc (12) -
start
_ profile (6) - stat (13)
- stdout (12)
- store (24)
- string (12)
- sum (42)
- superclass (12)
- synchronize (10)
- tag (11)
- taint (9)
- tainted? (9)
- tally (10)
- tap (12)
- tcp (24)
- then (7)
-
thread
_ variable _ get (12) - throw (12)
- timeout (29)
-
to
_ a (48) -
to
_ ary (12) -
to
_ enum (48) -
to
_ h (19) -
to
_ hash (36) -
to
_ int (12) -
to
_ json (12) -
to
_ json _ raw (12) -
to
_ json _ raw _ object (12) -
to
_ s (78) -
to
_ value (12) -
to
_ yaml (12) - tokenize (12)
-
trace
_ func (24) -
trace
_ object _ allocations (12) -
trace
_ object _ allocations _ start (12) -
trace
_ object _ allocations _ stop (12) - transact (18)
- transaction (12)
- transfer (12)
- transform (12)
- umask (6)
-
undefine
_ finalizer (12) - union (7)
- uniq (24)
- uniq! (24)
- unix (24)
-
unix
_ server _ socket (24) - unpack1 (9)
- unparse (12)
- unshift (12)
- untaint (9)
- untrusted? (3)
-
used
_ modules (12) - value (59)
- values (36)
-
values
_ at (36) -
variable
_ kind (12) - variables (12)
- varkind (12)
- version (12)
- visible? (12)
-
win
_ platform? (12) -
with
_ index (24) -
with
_ object (48) - wrap (48)
- write (12)
-
write
_ nonblock (12) - xpopen (24)
- yaml (12)
-
yaml
_ as (4) -
yaml
_ tag (12) - yield (24)
-
yield
_ self (8) - zip (48)
- | (12)
- このマニュアルのヘルプ (12)
- クラス/メソッドの定義 (12)
- スレッド (12)
- セキュリティモデル (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- 変数と定数 (12)
検索結果
先頭5件
-
Object
# initialize _ copy(obj) -> object (27285.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...変数や特異メソッドは変化しません。
デフォルトでは、Object#clone の内部で Object#initialize_clone から、
また Object#dup の内部で Object#initialize_dup から呼ばれます。
initialize_copy は、Ruby インタプリタが知り得ない情報をコピーす......initialize_copy でコピーするよう定義しておくことで、dup や clone
を再定義する必要がなくなります。
デフォルトの Object#initialize_copy は、 freeze チェックおよび型のチェックを行い self
を返すだけのメソッドです。
initialize_cop......いう名前のメソッドは
自動的に private に設定されます。
@raise TypeError レシーバが freeze されているか、obj のクラスがレシーバ
のクラスと異なる場合に発生します。
@see Object#clone,Object#dup
以下に例として、dup や clone がこ... -
Object
# initialize _ clone(obj) -> object (27235.0) -
Object#clone がオブジェクトを複製する際に呼び出すメソッドです。
...
Object#clone がオブジェクトを複製する際に呼び出すメソッドです。
デフォルトでは Object#initialize_copy を呼び出します。
initialize_clone という名前のメソッドは自動的に private に設定されます。
@see Object#initialize_copy, Object#initi......alize_dup... -
Object
# initialize _ dup(obj) -> object (27235.0) -
Object#dup がオブジェクトを複製する際に呼び出すメソッドです。
...
Object#dup がオブジェクトを複製する際に呼び出すメソッドです。
デフォルトでは Object#initialize_copy を呼び出します。
initialize_dup という名前のメソッドは自動的に private に設定されます。
@see Object#initialize_copy, Object#initializ... -
Object
# instance _ variable _ set(var , value) -> object (27225.0) -
オブジェクトのインスタンス変数 var に値 value を設定します。
...スタンス変数 var に値 value を設定します。
インスタンス変数が定義されていなければ新たに定義されます。
@param var インスタンス変数名を文字列か Symbol で指定します。
@param value 設定する値です。
@return value を返します......。
//emlist[][ruby]{
obj = Object.new
p obj.instance_variable_set("@foo", 1) #=> 1
p obj.instance_variable_set(:@foo, 2) #=> 2
p obj.instance_variable_get(:@foo) #=> 2
//}
@see Object#instance_variable_get,Object#instance_variables,Object#instance_variable_defined?... -
Object
# instance _ variable _ get(var) -> object | nil (27219.0) -
オブジェクトのインスタンス変数の値を取得して返します。
...@param var インスタンス変数名を文字列か Symbol で指定します。
//emlist[][ruby]{
class 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
# class -> Class (27218.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Object
# singleton _ class -> Class (27218.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...e か false なら、それぞれ NilClass, TrueClass,
FalseClass を返します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #=> #<Class:Stri......ng>
nil.singleton_class #=> NilClass
//}
@see Object#class... -
Object
# to _ ary -> Array (27218.0) -
オブジェクトの Array への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...オブジェクトの Array への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必要......すべての場面で代置可能であるような、
* 配列そのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_ary
[3,4]
end
end
it = Foo.new
p([1,2] + it) #=> [1, 2, 3, 4]
//}
@see Object#to_a,Kernel.#Array... -
Object
# marshal _ dump -> object (27213.0) -
Marshal.#dump を制御するメソッドです。
...Marshal.#dump を制御するメソッドです。
Marshal.dump(some) において、出力するオブジェクト some がメソッド marshal_dump を
持つ場合には、その返り値がダンプされたものが Marshal.dump(some) の返り値となります。
marshal_dump/marshal_load......_dump/_load ではなく
marshal_dump/marshal_load を使うべきです。
@return 任意のオブジェクトで marshal_load の引数に利用できます。
//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def marshal_dump
@foo
end
def marshal_load(obj)
p......定義されていてもマーシャルできるようになります
(特異メソッドの情報が自動的に dump されるようになるわけではなく、
marshal_dump/marshal_load によりそれを実現する余地があるということです)。
@see Object#marshal_load, Marshal...