種類
ライブラリ
- ビルトイン (1688)
- drb (11)
- erb (11)
-
fiddle
/ import (77) - forwardable (22)
-
irb
/ context (11) -
minitest
/ spec (1) -
minitest
/ unit (1) - monitor (11)
-
mutex
_ m (33) - objspace (11)
- profiler (6)
- psych (8)
- rake (11)
-
rdoc
/ class _ module (11) -
rdoc
/ code _ object (11) -
rdoc
/ context (99) -
rdoc
/ normal _ module (11) -
rdoc
/ stats (22) -
rdoc
/ top _ level (44) - win32ole (33)
クラス
- BasicObject (66)
- Class (22)
- ERB (11)
-
Enumerator
:: Lazy (55) - Hash (5)
-
IRB
:: Context (11) - Method (33)
- Module (970)
- Object (220)
- Proc (16)
-
RDoc
:: CodeObject (11) -
RDoc
:: Context (99) -
RDoc
:: Stats (22) -
RDoc
:: TopLevel (44) - Refinement (3)
- SystemCallError (11)
- TracePoint (11)
- UnboundMethod (22)
- WIN32OLE (11)
-
WIN32OLE
_ TYPE (22)
モジュール
- Enumerable (44)
-
Fiddle
:: Importer (77) - Kernel (55)
- Marshal (22)
-
MiniTest
:: Assertions (1) -
Mutex
_ m (22) - ObjectSpace (11)
- Warning (8)
オブジェクト
- main (90)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - < (11)
- <= (11)
- <=> (11)
- === (33)
- > (11)
- >= (11)
- Class (11)
- ClassModule (11)
- DRbProtocol (11)
- DomainError (11)
- Enumerator (11)
- Forwardable (11)
- Marshal フォーマット (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) - NormalModule (11)
-
Profiler
_ _ (6) - RMODULE (11)
- Ruby プログラムの実行 (11)
- Ruby用語集 (11)
- SingleForwardable (11)
- UnboundMethod (11)
-
add
_ class _ or _ module (22) -
add
_ module (11) -
alias
_ method (11) -
all
_ classes _ and _ modules (11) - ancestors (11)
-
append
_ features (22) -
assert
_ instance _ of (1) - attr (33)
-
attr
_ accessor (11) -
attr
_ reader (11) -
attr
_ writer (11) - autoload (22)
- autoload? (11)
- bind (22)
-
boot
_ defclass (11) - class (11)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) -
const
_ added (2) -
const
_ defined? (11) -
const
_ get (11) -
const
_ load (11) -
const
_ missing (11) -
const
_ set (11) -
const
_ source _ location (5) - constants (22)
-
count
_ objects _ size (11) -
create
_ value (11) - debug (11)
-
def
_ module (11) -
default
_ event _ sources (11) -
define
_ method (44) -
defined
_ class (11) -
deprecate
_ constant (9) - drb (11)
- dump (22)
- e2mmap (6)
-
each
_ classmodule (11) -
enum
_ for (44) - eval (22)
- extend (11)
-
extend
_ object (22) - extended (11)
- extern (11)
- fiddle (11)
-
fiddle
/ import (11) -
fiddle
/ types (11) -
find
_ enclosing _ module _ named (11) -
find
_ local _ symbol (22) -
find
_ module _ named (22) -
find
_ symbol (11) - freeze (11)
-
global
_ variables (11) -
import
_ methods (3) - include (22)
- include? (11)
-
include
_ class _ new (11) - included (11)
-
included
_ modules (11) -
infect
_ with _ assertions (1) -
initialize
_ classes _ and _ modules (11) - inspect (22)
-
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ methods (11) -
instance
_ variables (11) -
is
_ a? (11) -
kind
_ of? (11) - lambda? (11)
-
load
_ modules (11) -
local
_ variables (11) -
max
_ by (44) - method (11)
-
method
_ added (11) -
method
_ defined? (11) -
method
_ removed (11) -
method
_ undefined (11) - methods (11)
-
module
_ eval (22) -
module
_ exec (11) -
module
_ function (19) -
module
_ setup (11) - modules (11)
- name (11)
- nesting (11)
- new (55)
-
num
_ modules (11) -
num
_ modules= (11) -
ole
_ type (11) -
original
_ module (11) - owner (22)
- prepend (11)
-
prepend
_ features (11) - prepended (11)
- private (46)
-
private
_ class _ method (15) -
private
_ constant (11) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) - protected (23)
-
protected
_ instance _ methods (11) -
protected
_ method _ defined? (11) -
protected
_ methods (11) -
psych
_ yaml _ as (4) - public (46)
-
public
_ class _ method (15) -
public
_ constant (11) -
public
_ instance _ method (11) -
public
_ instance _ methods (11) -
public
_ method (11) -
public
_ method _ defined? (11) -
public
_ methods (11) - rake (11)
-
rake
_ extension (11) -
rb
_ class _ instance _ methods (11) -
rb
_ class _ path (11) -
rb
_ class _ private _ instance _ methods (11) -
rb
_ class _ protected _ instance _ methods (11) -
rb
_ define _ module (11) -
rb
_ define _ module _ function (11) -
rb
_ define _ module _ id (11) -
rb
_ define _ module _ under (11) -
rb
_ extend _ object (11) -
rb
_ include _ module (11) -
rb
_ mod _ append _ features (11) -
rb
_ mod _ include (11) -
rb
_ mod _ included _ modules (11) -
rb
_ mod _ initialize (11) -
rb
_ mod _ modfunc (11) -
rb
_ mod _ module _ eval (11) -
rb
_ mod _ name (11) -
rb
_ mod _ private (11) -
rb
_ mod _ protected (11) -
rb
_ mod _ public (11) -
rb
_ mod _ remove _ method (11) -
rb
_ module _ new (11) -
rb
_ module _ s _ alloc (11) - rdoc (11)
-
rdoc
/ class _ module (11) -
rdoc
/ normal _ module (11) - refine (11)
-
remove
_ class _ variable (11) -
remove
_ classes _ and _ modules (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) -
remove
_ method (11) -
respond
_ to? (11) - rss (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) -
ruby2
_ keywords (10) -
ruby2
_ keywords _ hash? (5) -
singleton
_ class? (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - sizeof (11)
-
specific
_ eval (11) - struct (11)
-
to
_ enum (44) -
to
_ s (22) -
undef
_ method (11) - union (11)
-
used
_ modules (8) - using (22)
- value (11)
- warn (8)
- xmlrpc (3)
- yaml (11)
-
yaml
_ as (4) - クラス/メソッドの定義 (11)
- 制御構造 (11)
- 変数と定数 (11)
- 字句構造 (11)
- 演算子式 (11)
検索結果
先頭5件
-
Module
# constants(inherit = true) -> [Symbol] (21048.0) -
そのモジュール(またはクラス)で定義されている定数名の配列を返します。
...@see Module.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables
//emlist[Module.constants と Module#constants の違い][ruby]{
# 出力の簡略化のため起動時の定数一覧を取得して後で差し引く
$clist = Module.const......ない
p Module.constants - $clist # => [:BAR, :Bar, :Foo]
class Baz
# Baz は定数を含まない
p constants # => []
# ネストしたクラスでは、外側のクラスで定義した定数は
# 参照可能なので、BAR は、Module.constant......s には含まれる
# (クラス Baz も Bar の定数なので同様)
p Module.constants - $clist # => [:BAR, :Baz, :Foo, :Bar]
end
end
//}... -
Module
# include(*mod) -> self (21036.0) -
モジュール mod をインクルードします。
...ます。
@param mod Module のインスタンス( Enumerable など)を指定します。
@raise ArgumentError 継承関係が循環してしまうような include を行った場合に発生します。
//emlist[例][ruby]{
module M
end
module M2
include M
end
module M
include M2
end
//}......ールのほうが
先に行われます
(上の例の Module#ancestors の結果がメソッド探索の順序です)。
同じモジュールを二回以上 include すると二回目以降は無視されます。
//emlist[例][ruby]{
module M
end
class C1
include M
end
class C2 < C1
include... -
Module
# prepend _ features(mod) -> self (21034.0) -
Module#prepend から呼び出されるメソッドで、 prepend の処理の実体です。このメソッド自体は mod で指定した モジュール/クラスの継承チェインの先頭に self を追加します。
...Module#prepend から呼び出されるメソッドで、
prepend の処理の実体です。このメソッド自体は mod で指定した
モジュール/クラスの継承チェインの先頭に self を追加します。
このメソッドを上書きすることで、prepend の処理を変......れます
//emlist[例][ruby]{
class Recorder
RECORDS = []
end
module X
def self.prepend_features(mod)
Recorder::RECORDS << mod
end
end
class A
prepend X
end
class B
include X
end
class C
prepend X
end
Recorder::RECORDS # => [A, C]
//}
@see Module#prepend, Module#prepended... -
Module
# inspect -> String (21030.0) -
モジュールやクラスの名前を文字列で返します。
...t[例][ruby]{
module A
module B
end
p B.name #=> "A::B"
class C
end
end
p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"
# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b0... -
Module
# name -> String | nil (21030.0) -
モジュールやクラスの名前を文字列で返します。
...t[例][ruby]{
module A
module B
end
p B.name #=> "A::B"
class C
end
end
p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"
# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b0... -
Module
# to _ s -> String (21030.0) -
モジュールやクラスの名前を文字列で返します。
...t[例][ruby]{
module A
module B
end
p B.name #=> "A::B"
class C
end
end
p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"
# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b0... -
Module
# <=(other) -> bool | nil (21024.0) -
比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。
...クラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo <= Bar # => false
Bar <= Foo # => true
Baz.ancest... -
Module
# >(other) -> bool | nil (21024.0) -
比較演算子。 self が other の先祖である場合、true を返します。 self が other の子孫か同一クラスである場合、false を返します。
...@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Awesome; end
module Included
include Awesome
end
module Prepended
prepend Awesome
end
Included.ancestors # => [Included, Awesome]
Awesome > Included # => tr... -
Module
# >=(other) -> bool | nil (21024.0) -
比較演算子。self が other の先祖か同一クラスである場合、 true を返します。 self が other の子孫である場合、false を返します。
...クラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo >= Bar # => true
Bar >= Foo # => false
Baz.ancest... -
Module
# method _ defined?(name) -> bool (21024.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...に
true を返します。
@param name Symbol か String を指定します。
@see Module#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined?
//emlist[例][ruby]{
module A
def method1() end
def protected_method1() end
protected :protected_method1
end... -
Module
# method _ defined?(name , inherit=true) -> bool (21024.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...モジュールで
定義されたメソッドも対象になります。
@see Module#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined?
//emlist[例][ruby]{
module A
def method1() end
def protected_method1() end
protected :protected_method1
end...