種類
ライブラリ
- English (22)
- ビルトイン (3668)
-
bigdecimal
/ util (6) - csv (77)
- delegate (11)
- digest (11)
- e2mmap (54)
- erb (44)
- etc (33)
- fiddle (11)
-
fiddle
/ import (22) - forwardable (66)
- getoptlong (22)
-
irb
/ extend-command (11) - json (209)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / time (11) - logger (1)
-
minitest
/ unit (1) - monitor (11)
-
mutex
_ m (33) -
net
/ http (44) -
net
/ imap (11) -
net
/ pop (22) - objspace (44)
- observer (11)
- openssl (1045)
- optparse (176)
- pp (33)
- psych (50)
- rake (44)
- rdoc (11)
-
rdoc
/ anon _ class (11) -
rdoc
/ class _ module (11) -
rdoc
/ code _ object (11) -
rdoc
/ context (77) -
rdoc
/ generator / json _ index (11) -
rdoc
/ known _ classes (11) -
rdoc
/ markup (22) -
rdoc
/ normal _ class (11) -
rdoc
/ parser (11) -
rdoc
/ single _ class (11) -
rdoc
/ stats (22) -
rdoc
/ top _ level (44) - resolv (44)
-
rexml
/ document (22) -
rexml
/ streamlistener (11) -
ripper
/ filter (11) -
rubygems
/ digest / digest _ adapter (11) -
rubygems
/ digest / md5 (11) -
rubygems
/ digest / sha1 (11) -
rubygems
/ digest / sha2 (11) -
rubygems
/ ext / builder (11) -
rubygems
/ gem _ openssl (22) -
rubygems
/ remote _ fetcher (11) -
rubygems
/ version (11) - set (33)
-
shell
/ command-processor (6) - singleton (11)
- socket (66)
- thread (2)
- timeout (46)
- tracer (77)
- tsort (85)
- uri (22)
-
webrick
/ httpauth / authenticator (22) -
webrick
/ httpauth / userdb (11) -
webrick
/ httpresponse (11) -
webrick
/ httpservlet / abstract (66) -
webrick
/ httpservlet / filehandler (11) -
webrick
/ httpstatus (11) -
webrick
/ httputils (88) -
win32
/ registry (209) - win32ole (88)
クラス
-
ARGF
. class (843) - Array (55)
- BasicObject (132)
- BigDecimal (11)
- CSV (77)
- Class (91)
- Complex (11)
- Data (4)
- Date (11)
- DateTime (11)
- Dir (66)
- ERB (33)
-
Enumerator
:: Lazy (16) -
Etc
:: Passwd (22) - Exception (22)
- FalseClass (55)
- File (55)
-
Gem
:: DigestAdapter (11) -
Gem
:: Ext :: Builder (11) -
Gem
:: RemoteFetcher (11) -
Gem
:: Version (11) - GetoptLong (22)
- Hash (72)
- IO (55)
- Integer (11)
-
JSON
:: Parser (22) -
JSON
:: State (22) - Method (194)
-
MiniTest
:: Unit :: TestCase (1) - Module (626)
- NameError (9)
-
Net
:: HTTP (22) -
Net
:: HTTPResponse (22) -
Net
:: IMAP (11) -
Net
:: POP3 (22) - NilClass (155)
- Object (453)
-
OpenSSL
:: ASN1 :: ASN1Data (33) -
OpenSSL
:: ASN1 :: BMPString (22) -
OpenSSL
:: ASN1 :: BitString (22) -
OpenSSL
:: ASN1 :: Boolean (22) -
OpenSSL
:: ASN1 :: Enumerated (22) -
OpenSSL
:: ASN1 :: GeneralString (22) -
OpenSSL
:: ASN1 :: GeneralizedTime (22) -
OpenSSL
:: ASN1 :: GraphicString (22) -
OpenSSL
:: ASN1 :: IA5String (22) -
OpenSSL
:: ASN1 :: ISO64String (22) -
OpenSSL
:: ASN1 :: Integer (22) -
OpenSSL
:: ASN1 :: Null (22) -
OpenSSL
:: ASN1 :: NumericString (22) -
OpenSSL
:: ASN1 :: ObjectId (22) -
OpenSSL
:: ASN1 :: OctetString (22) -
OpenSSL
:: ASN1 :: PrintableString (22) -
OpenSSL
:: ASN1 :: Sequence (22) -
OpenSSL
:: ASN1 :: Set (22) -
OpenSSL
:: ASN1 :: T61String (22) -
OpenSSL
:: ASN1 :: UTCTime (22) -
OpenSSL
:: ASN1 :: UTF8String (22) -
OpenSSL
:: ASN1 :: UniversalString (22) -
OpenSSL
:: ASN1 :: VideotexString (22) - OptionParser (176)
- PP (11)
- Proc (23)
-
RDoc
:: CodeObject (11) -
RDoc
:: Context (77) -
RDoc
:: Generator :: JsonIndex (11) -
RDoc
:: Markup (11) -
RDoc
:: Parser (11) -
RDoc
:: Stats (22) -
RDoc
:: TopLevel (44) -
REXML
:: CData (22) - Random (2)
- Range (22)
- Rational (11)
- Regexp (22)
-
Resolv
:: DNS (33) -
RubyVM
:: InstructionSequence (11) - Set (11)
-
Shell
:: CommandProcessor (6) - Socket (33)
- String (11)
- Struct (55)
- Thread (33)
-
Thread
:: Backtrace :: Location (44) - Time (11)
- TracePoint (44)
- Tracer (77)
- TrueClass (55)
-
URI
:: Generic (22) - UnboundMethod (44)
-
WEBrick
:: HTTPResponse (11) -
WEBrick
:: HTTPServlet :: AbstractServlet (66) -
WEBrick
:: HTTPServlet :: FileHandler (11) -
WEBrick
:: HTTPUtils :: FormData (88) -
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ TYPE (44) -
WIN32OLE
_ TYPELIB (33) -
Win32
:: Registry (99) -
Win32
:: Registry :: PredefinedKey (11)
モジュール
-
ERB
:: DefMethod (11) - Enumerable (154)
- Exception2MessageMapper (54)
-
Fiddle
:: Importer (22) - Forwardable (44)
- Gem (33)
-
Gem
:: SSL (22) -
IRB
:: ExtendCommandBundle (11) - JSON (33)
-
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kernel (192)
- Marshal (22)
-
Mutex
_ m (22) - ObjectSpace (132)
-
OpenSSL
:: ASN1 (506) - Psych (17)
- RDoc (22)
-
REXML
:: StreamListener (11) -
Rake
:: TaskManager (22) -
Socket
:: Constants (33) - TSort (85)
- Timeout (19)
-
WEBrick
:: HTTPAuth :: Authenticator (11) -
WEBrick
:: HTTPAuth :: ProxyAuthenticator (11) -
WEBrick
:: HTTPAuth :: UserDB (11) -
WEBrick
:: HTTPStatus (11) -
Win32
:: Registry :: Constants (99)
キーワード
- ! (11)
- != (11)
-
$ ERROR _ INFO (11) -
$ ERROR _ POSITION (11) -
$ FILENAME (11) - & (33)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - < (11)
- << (12)
- <=> (11)
- == (22)
- === (18)
- =~ (6)
- >> (12)
- APOP (11)
- ARGF (22)
-
ARGF
. class (11) - ASN1 (11)
- AnonClass (11)
- Application (1)
- AuthException (22)
- BMPString (22)
- BasicObject (11)
- BitString (22)
- Boolean (22)
-
CLASS
_ MODIFIERS (11) -
CLASS
_ OF (11) -
CODE
_ CLASS _ TO _ OBJ (11) - ClassModule (11)
- Closure (11)
- ConditionVariable (11)
- DEFAULT (2)
-
DIGEST
_ SHA1 (11) - DelegateClass (11)
-
EVENT
_ SYMBOL (11) - Enumerated (22)
- Error (11)
- FALSE (8)
- Fail (12)
- FalseClass (33)
- Filter (11)
- Forwardable (11)
- GeneralString (22)
- GeneralizedTime (22)
- GraphicString (22)
-
HKEY
_ CLASSES _ ROOT (22) -
HKEY
_ CURRENT _ CONFIG (22) -
HKEY
_ CURRENT _ USER (22) -
HKEY
_ DYN _ DATA (22) -
HKEY
_ LOCAL _ MACHINE (22) -
HKEY
_ PERFORMANCE _ DATA (22) -
HKEY
_ PERFORMANCE _ NLSTEXT (22) -
HKEY
_ PERFORMANCE _ TEXT (22) -
HKEY
_ USERS (22) - IA5String (22)
- IN (11)
-
IPPROTO
_ TP (22) -
IPV6
_ RECVTCLASS (22) -
IPV6
_ TCLASS (22) - ISO64String (22)
- Integer (22)
-
KNOWN
_ CLASSES (11) - Location (11)
- MD5 (11)
- Markup (11)
- Marshal フォーマット (11)
- Method (11)
- MonitorMixin (11)
-
Mutex
_ m (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NIL (8)
- NilClass (33)
- NormalClass (11)
- Null (22)
- Numeric (11)
- NumericString (22)
- ObjectId (22)
- Observable (11)
- OctetString (22)
- Options (11)
-
PASSTHROUGH
_ EXCEPTIONS (1) -
PKEY
_ RSA (11) - Parser (11)
- Passwd (11)
- PrintableString (22)
- Proxy (11)
- RCLASS (11)
- RMODULE (11)
- Raise (12)
- ReFe (11)
- Requirement (11)
- Ruby プログラムの実行 (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- SHA1 (11)
- SHA256 (11)
- Sequence (22)
- Set (22)
- SingleClass (11)
- SingleForwardable (11)
- Singleton (11)
- String (11)
- T61String (22)
- TRUE (8)
- TYPES (11)
- TrueClass (33)
- UTCTime (22)
- UTF8String (22)
- UnboundMethod (11)
- UniversalString (22)
- VideotexString (22)
- Visitors (11)
- [] (66)
- ^ (33)
-
_ _ send _ _ (22) -
_ dump (11) -
_ load (11) -
absolute
_ path (11) - accept (22)
-
add
_ authenticator (11) -
add
_ class (11) -
add
_ class _ or _ module (22) -
add
_ filter (22) -
add
_ module (11) -
add
_ special (11) -
add
_ trace _ func (11) -
all
_ classes _ and _ modules (11) - allocate (11)
- ancestors (11)
-
append
_ features (22) - argv (11)
- arity (22)
- attr (9)
-
attr
_ accessor (3) -
attr
_ reader (3) -
attr
_ writer (3) -
auth
_ type (11) - autoload (22)
- autoload? (11)
- backtrace (11)
-
base
_ label (11) - bind (11)
- binmode (11)
- binmode? (11)
-
boot
_ defclass (11) - bytes (14)
- call (22)
-
callee
_ id (11) - cgi (11)
-
cgi
/ session (11) - chars (14)
- class (22)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ name (11) -
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) - classes (11)
- classify (11)
- classname (11)
- clone (33)
- close (11)
- closed? (11)
- codepoints (14)
- component (11)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ missing (11) -
const
_ source _ location (5) - constants (22)
-
count
_ objects (11) -
count
_ objects _ size (11) -
count
_ tdata _ objects (11) - coverage (7)
-
create
_ id (11) -
create
_ id= (11) - debug (11)
- decode (11)
-
def
_ builtin _ commands (6) -
def
_ class (11) -
def
_ delegator (11) -
def
_ erb _ method (11) -
def
_ exception (12) -
def
_ extend _ command (11) -
def
_ instance _ delegator (11) -
def
_ module (11) -
default
_ event _ sources (11) -
default
_ port (11) - define (4)
-
define
_ aliases (11) -
define
_ finalizer (22) -
define
_ method (22) -
define
_ singleton _ method (22) -
define
_ task (11) -
defined
_ class (11) - delegate (11)
- display (11)
-
do
_ DELETE (11) -
do
_ GET (11) -
do
_ HEAD (11) -
do
_ OPTIONS (11) -
do
_ POST (11) -
do
_ PUT (11) - drb (11)
-
drb
/ extservm (11) -
drb
/ gw (11) - dump (22)
- dup (22)
- e2mmap (6)
- each (44)
-
each
_ byte (22) -
each
_ char (22) -
each
_ classmodule (11) -
each
_ codepoint (22) -
each
_ data (11) -
each
_ entry (22) -
each
_ line (44) -
each
_ object (44) -
each
_ resource (11) -
each
_ strongly _ connected _ component (21) -
each
_ strongly _ connected _ component _ from (21) - eager (5)
- entitydecl (11)
- eof (11)
- eof? (11)
- error (11)
- error? (11)
- extend (11)
-
external
_ encoding (11) - fail (39)
- file (11)
- filename (22)
- filename= (11)
- fileno (11)
-
find
_ class _ named (11) -
find
_ class _ path (11) -
find
_ local _ symbol (11) -
fixed
_ encoding? (11) -
for
_ fd (11) -
from
_ state (11) - getbyte (11)
- getc (11)
- getresource (11)
- getresources (11)
- gets (33)
-
global
_ variables (11) - handler= (11)
-
http
_ version (11) - include (11)
- include? (11)
-
include
_ class _ new (11) - included (11)
- inherited (11)
- initialize (11)
-
initialize
_ classes _ and _ modules (11) -
initialize
_ copy (11) -
inplace
_ mode (11) -
inplace
_ mode= (11) -
ins
_ methods _ i (11) -
ins
_ methods _ priv _ i (11) -
ins
_ methods _ prot _ i (11) - inspect (77)
-
instance
_ delegate (11) -
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ methods (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variables (11) - intern (11)
-
internal
_ encoding (11) - irb (11)
-
irb
/ completion (11) -
is
_ a? (11) -
json
/ add / core (11) -
json
_ creatable? (11) -
kind
_ of? (11) - lambda? (11)
- lineno (11)
- lineno= (11)
- lines (42)
- list (11)
-
local
_ variables (11) -
marshal
_ dump (11) -
marshal
_ load (11) - max (44)
- merge (22)
-
method
_ added (11) -
method
_ defined? (11) -
method
_ id (11) -
method
_ missing (11) -
method
_ removed (11) -
method
_ undefined (11) - methods (11)
- min (44)
-
minitest
/ unit (1) -
module
_ eval (22) -
module
_ exec (11) - name (33)
- name= (11)
- nesting (11)
- new (726)
- nil? (11)
-
num
_ classes (11) -
num
_ classes= (11) -
object
_ group (11) -
ole
_ classes (22) -
ole
_ type (11) -
ole
_ types (11) - on (154)
- open (132)
-
original
_ name (22) - owner (22)
- parameters (11)
- parse (11)
-
parse
_ files _ matching (11) - path (22)
- pathmap (11)
- pos (11)
- pos= (11)
- pp (11)
- prepend (11)
-
prepend
_ features (11) - prepended (11)
-
pretty
_ print (11) -
pretty
_ print _ cycle (11) - print (11)
- printf (11)
- private (23)
-
private
_ class _ method (15) -
private
_ constant (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
proxy
_ class? (11) -
public
_ class _ method (15) -
public
_ constant (11) -
public
_ method (11) -
public
_ method _ defined? (11) - putc (11)
- puts (11)
- raise (33)
-
rake
/ classic _ namespace (11) -
rake
_ extension (11) - rationalize (22)
-
rb
_ catch (11) -
rb
_ class2name (11) -
rb
_ class _ allocate _ instance (11) -
rb
_ class _ boot (11) -
rb
_ class _ inherited (11) -
rb
_ class _ initialize (11) -
rb
_ class _ instance _ methods (11) -
rb
_ class _ new (11) -
rb
_ class _ new _ instance (11) -
rb
_ class _ path (11) -
rb
_ class _ private _ instance _ methods (11) -
rb
_ class _ protected _ instance _ methods (11) -
rb
_ class _ real (11) -
rb
_ class _ s _ new (11) -
rb
_ class _ superclass (11) -
rb
_ clear _ cache _ by _ class (11) -
rb
_ define _ class (11) -
rb
_ define _ class _ id (11) -
rb
_ define _ class _ under (11) -
rb
_ define _ class _ variable (11) -
rb
_ frozen _ class _ p (11) -
rb
_ is _ class _ id (11) -
rb
_ mod _ class _ variables (11) -
rb
_ name _ class (11) -
rb
_ obj _ class (11) -
rb
_ path2class (11) -
rb
_ set _ class _ path (11) -
rb
_ singleton _ class (11) -
rb
_ singleton _ class _ attached (11) -
rb
_ singleton _ class _ clone (11) -
rb
_ singleton _ class _ new (11) - rdoc (11)
-
rdoc
/ anon _ class (11) -
rdoc
/ class _ module (11) -
rdoc
/ generator (11) -
rdoc
/ generator / json _ index (11) -
rdoc
/ known _ classes (11) -
rdoc
/ normal _ class (11) -
rdoc
/ parser (11) -
rdoc
/ parser / c (11) -
rdoc
/ single _ class (11) -
reachable
_ objects _ from (11) - read (22)
-
read
_ nonblock (11) - readbyte (22)
- readchar (11)
- readline (33)
- readlines (44)
- readpartial (11)
- receiver (20)
- refine (11)
- reject (22)
-
remove
_ class _ variable (11) -
remove
_ classes _ and _ modules (11) -
remove
_ const (11) -
remove
_ handler (11) -
remove
_ instance _ variable (11) -
remove
_ method (11) - replace (11)
- request (11)
-
respond
_ to? (11) -
respond
_ to _ missing? (11) - rewind (11)
-
rexml
/ parsers / sax2parser (11) -
rexml
/ parsers / streamparser (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
rubygems
/ command _ manager (11) -
safe
_ load (17) - seek (11)
- send (22)
-
set
_ encoding (33) -
set
_ get _ line _ procs (22) -
set
_ trace _ func (22) -
singleton
_ class (11) -
singleton
_ class? (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - skip (11)
-
socket
_ type (11) -
sort
_ by (22) -
source
_ location (11) - stat (11)
-
strongly
_ connected _ components (11) - struct (11)
- subclasses (3)
-
super
_ method (10) - superclass (22)
-
tag
_ class (11) -
tag
_ class= (11) - tell (11)
-
test
/ unit (1) - timeout (35)
-
to
_ a (66) -
to
_ ary (33) -
to
_ bn (11) -
to
_ c (11) -
to
_ d (6) -
to
_ f (11) -
to
_ h (28) -
to
_ hash (11) -
to
_ i (22) -
to
_ int (11) -
to
_ io (11) -
to
_ json (154) -
to
_ json _ raw _ object (11) -
to
_ proc (22) -
to
_ r (11) -
to
_ regexp (11) -
to
_ s (99) -
to
_ set (22) -
to
_ str (11) -
to
_ write _ io (11) -
trace
_ object _ allocations (11) - tracer (11)
- traverse (11)
- tsort (22)
-
tsort
_ each (21) - uclass (11)
- uclass= (11)
- unbind (11)
-
undef
_ method (11) -
undefine
_ finalizer (11) - union (11)
- value (22)
-
webrick
/ cgi (11) - write (11)
- yaml (11)
-
yaml
_ tag (11) - | (33)
- オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (11)
- クラス (11)
- クラス/メソッドの定義 (11)
- メソッド呼び出し(super・ブロック付き・yield) (11)
- リテラル (11)
- 制御構造 (11)
- 変数と定数 (11)
- 字句構造 (11)
- 正規表現 (11)
- 演算子式 (11)
検索結果
先頭5件
-
Class (38012.0)
-
クラスのクラスです。
...正確に言えば、個々のクラスはそれぞれメタクラスと呼
ばれる名前のないクラスをクラスとして持っていて、Class はそのメタ
クラスのクラスです。この関係は少し複雑ですが、Ruby を利用するにあたっ
ては特に重要ではあ......すが、それ以外のほとんどの機能は Module から継
承されています。Module のメソッドのうち
* Module#module_function
* Module#extend_object
* Module#append_features
* Module#prepend_features
* Module#refine
は Class では未定義にされています。... -
Class
# subclasses -> [Class] (27231.0) -
自身が直接のスーパークラスになっている(特異クラスを除く)クラスの配列を返します。 返り値の配列の順序は未定義です。
...を除く)クラスの配列を返します。
返り値の配列の順序は未定義です。
//emlist[例][ruby]{
class A; end
class B < A; end
class C < B; end
class D < A; end
A.subclasses # => [D, B]
B.subclasses # => [C]
C.subclasses # => []
//}
@see Class#superclass... -
Class
# superclass -> Class | nil (27219.0) -
自身のスーパークラスを返します。
...{
File.superclass #=> IO
IO.superclass #=> Object
class Foo; end
class Bar < Foo; end
Bar.superclass #=> Foo
Object.superclass #=> BasicObject
//}
ただし BasicObject.superclass は nil を返します。
//emlist[例][ruby]{
BasicObject.superclass #=> nil......//}
@see Class#subclasses... -
Class
. new(superclass = Object) -> Class (21232.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 = Class... -
Class
. new(superclass = Object) {|klass| . . . } -> Class (21232.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 = Class... -
Class
# inherited(subclass) -> () (21136.0) -
クラスのサブクラスが定義された時、新しく生成されたサブクラスを引数 にインタプリタから呼び出されます。このメソッドが呼ばれるタイミングは クラス定義文の実行直前です。
...@param subclass プログラム内で新たに定義された自身のサブクラスです。
//emlist[例][ruby]{
class Foo
def Foo.inherited(subclass)
puts "class \"#{self}\" was inherited by \"#{subclass}\""
end
end
class Bar < Foo
puts "executing class body"
end
# => class "Foo" was......inherited by "Bar"
# executing class body
//}... -
Class
# _ load(str) -> Class (21101.0) -
Object#_dump を参照して下さい。
Object#_dump を参照して下さい。
@param str Ruby のオブジェクトがダンプされた文字列を指定します。 -
Class
# new(*args , &block) -> object (21024.0) -
自身のインスタンスを生成して返します。 このメソッドの引数はブロック引数も含め 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>
//}... -
Class
# allocate -> object (21006.0) -
自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。
...したオブジェクトは
自身のインスタンスであること以外には何も特性を持ちません。
//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end
def initialized?
@initialized || false
end
end
klass.allocate.initialized? #=... -
Class
# json _ creatable? -> bool (21000.0) -
シリアライズされた JSON 形式の文字列から、インスタンスを作成するのにこのクラスを使用できる場合は 真を返します。そうでない場合は、偽を返します。
シリアライズされた JSON 形式の文字列から、インスタンスを作成するのにこのクラスを使用できる場合は
真を返します。そうでない場合は、偽を返します。
このメソッドが真を返すクラスは json_create というメソッドを実装していなければなりません。
また json_create の第一引数は必要なデータを含むハッシュを期待しています。
//emlist[例][ruby]{
require "json"
String.json_creatable? # => true
Dir.json_creatable? # => false
//}