ライブラリ
- ビルトイン (5225)
クラス
-
ARGF
. class (132) - Array (245)
- BasicObject (144)
- Binding (59)
- Class (40)
- Data (6)
- Dir (72)
-
Encoding
:: Converter (48) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) - Enumerator (120)
-
Enumerator
:: ArithmeticSequence (35) -
Enumerator
:: Lazy (48) -
Enumerator
:: Yielder (30) - Exception (128)
- Fiber (34)
- File (36)
-
File
:: Stat (72) - FrozenError (6)
- Hash (79)
- IO (322)
- Integer (23)
- KeyError (16)
- LoadError (12)
- LocalJumpError (24)
- MatchData (102)
- Method (223)
- Module (975)
- Mutex (8)
- NameError (44)
- NoMethodError (12)
- Numeric (105)
- Object (456)
- Proc (92)
- Random (36)
- Range (148)
- Refinement (4)
- Regexp (72)
-
RubyVM
:: InstructionSequence (60) - Set (6)
- SignalException (24)
- StopIteration (12)
- String (193)
- Symbol (12)
- SystemCallError (12)
- SystemExit (24)
- Thread (144)
-
Thread
:: Backtrace :: Location (48) -
Thread
:: ConditionVariable (20) -
Thread
:: Mutex (40) -
Thread
:: Queue (40) -
Thread
:: SizedQueue (30) - Time (2)
- TracePoint (189)
- UnboundMethod (36)
- UncaughtThrowError (33)
モジュール
- Comparable (12)
- Enumerable (244)
キーワード
- ! (12)
- != (12)
- % (12)
-
/ (11) - < (12)
- << (26)
- <= (12)
- <=> (12)
- == (55)
- === (75)
- =~ (12)
- > (12)
- >= (12)
- >> (14)
- [] (120)
- []= (36)
-
_ _ send _ _ (24) -
_ dump (12) -
absolute
_ path (24) -
add
_ trace _ func (12) -
alias
_ method (12) - allocate (12)
- ancestors (12)
- append (8)
-
append
_ features (12) - args (12)
- arity (24)
- at (12)
- attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - autoclose? (12)
- autoload (12)
- backtrace (24)
-
backtrace
_ locations (12) -
base
_ label (24) - begin (31)
- bind (12)
- binding (24)
- binmode (12)
- blockdev? (12)
- broadcast (10)
- byteoffset (6)
- call (36)
-
callee
_ id (12) - cause (12)
- chardev? (12)
- chunk (12)
- clamp (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - clone (36)
- close (10)
-
close
_ read (12) -
close
_ write (12) - coerce (12)
- compact (4)
-
const
_ added (3) -
const
_ defined? (12) -
const
_ get (12) -
const
_ missing (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
- cover? (19)
- crypt (12)
- curry (22)
- deconstruct (3)
-
deconstruct
_ keys (5) -
default
_ proc= (12) -
define
_ method (24) -
define
_ singleton _ method (24) -
defined
_ class (12) -
delete
_ suffix (8) -
delete
_ suffix! (8) - deq (20)
- disable (24)
- display (12)
- div (12)
- divide (6)
- dup (24)
- each (120)
-
each
_ byte (48) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ index (24) -
each
_ line (72) -
each
_ with _ index (24) - enable (24)
-
end
_ with? (18) -
enum
_ for (48) - eql? (12)
- errno (12)
-
error
_ bytes (12) -
error
_ char (12) - eval (12)
-
eval
_ script (7) - event (12)
- exception (24)
-
exclude
_ end? (19) - exit (12)
-
exit
_ value (12) - extend (12)
-
extend
_ object (12) - extended (12)
- fcntl (12)
- fdatasync (12)
- feed (12)
- fetch (36)
- first (24)
-
first
_ lineno (12) -
fixed
_ encoding? (12) - flush (12)
- freeze (12)
- hash (19)
-
import
_ methods (4) - include (12)
- include? (12)
- included (12)
-
included
_ modules (12) -
incomplete
_ input? (12) - inherited (12)
- initialize (12)
-
initialize
_ copy (12) -
inplace
_ mode= (12) - inspect (72)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instruction
_ sequence (7) -
internal
_ encoding (12) - invert (12)
-
is
_ a? (12) - key (8)
- kill (12)
-
kind
_ of? (12) - label (12)
- lambda? (12)
- last (24)
- lazy (12)
- lineno (12)
-
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (21) - lstat (12)
-
marshal
_ dump (12) - match (24)
- max (48)
-
max
_ by (48) - merge (24)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) -
method
_ removed (12) -
method
_ undefined (12) - methods (12)
- min (48)
-
module
_ eval (24) -
module
_ exec (12) -
module
_ function (36) - name (36)
- next (12)
-
next
_ values (12) - offset (24)
-
original
_ name (24) - overlap? (2)
- owned? (12)
- owner (12)
- pack (21)
- parameters (7)
- path (48)
-
peek
_ values (12) -
pending
_ interrupt? (12) - pid (12)
- pop (20)
- pos (12)
- pos= (24)
- pread (8)
- prepend (41)
-
prepend
_ features (12) - prepended (12)
-
primitive
_ convert (48) - priority (12)
- priority= (12)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) - public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ method _ defined? (12) -
public
_ send (24) - push (8)
- pwrite (8)
- raise (30)
-
raised
_ exception (12) - rand (36)
- read (12)
- readbyte (24)
- readchar (12)
- reason (12)
- receiver (36)
- refine (12)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) - replace (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) - result (12)
- resume (12)
-
return
_ value (12) - rewind (12)
-
ruby2
_ keywords (18) - seek (24)
- send (24)
-
set
_ backtrace (12) -
set
_ encoding _ by _ bom (6) -
set
_ trace _ func (12) - setgid? (12)
- setuid? (12)
- shift (20)
- signal (10)
- signm (12)
- signo (12)
-
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) - size (12)
- sleep (12)
- socket? (12)
-
sort
_ by (24) -
source
_ location (12) -
start
_ with? (18) - stat (12)
- status (12)
- step (93)
- sticky? (12)
- subclasses (4)
- success? (12)
- sum (12)
-
super
_ method (11) - superclass (12)
- sync (12)
- synchronize (12)
- sysseek (12)
- syswrite (12)
- tag (11)
- tell (12)
- terminate (12)
-
thread
_ variable _ set (12) -
to
_ a (12) -
to
_ ary (24) -
to
_ enum (48) -
to
_ h (19) -
to
_ hash (12) -
to
_ int (12) -
to
_ path (12) -
to
_ proc (30) -
to
_ regexp (12) -
to
_ s (83) -
to
_ str (12) - transfer (4)
- truncate (12)
- unbind (12)
-
undef
_ method (12) - unlock (12)
- unpack (12)
- unshift (8)
- upto (12)
- value (11)
-
with
_ object (24) - write (12)
- yield (24)
- ~ (12)
検索結果
先頭5件
-
MatchData
# end(n) -> Integer | nil (26138.0) -
n 番目の部分文字列終端のオフセットを返します。
...IndexError 範囲外の n を指定した場合に発生します。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end(4) # => `end': index 4 out of matches (IndexError)
//}
@see MatchData#begin... -
Range
# end -> object (26103.0) -
終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま せん。
終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま
せん。
//emlist[例][ruby]{
(10..20).last # => 20
(10...20).last # => 20
//}
@see Range#begin -
Enumerator
:: ArithmeticSequence # end -> Numeric | nil (26102.0) -
末項(終端)を返します。
末項(終端)を返します。
@see Enumerator::ArithmeticSequence#begin -
Module
# prepend(*modules) -> self (14149.0) -
指定したモジュールを self の継承チェインの先頭に「追加する」ことで self の定数、メソッド、モジュール変数を「上書き」します。
...を処理するため、prependの引数として
渡したモジュールのインスタンスメソッドでsuperを呼ぶことで
self のモジュール/クラスのメソッドを呼び出すことができます。
実際の処理は modules の各要素の prepend_features を後ろから......けです。
Module#prepend_features が継承チェインの改変を実行し、結果として上のような
処理が実現されます。そのため、prepend_features を override することで
prepend の処理を追加/変更できます。
@param modules prepend する Module を指......します
@see Module#prepend_features, Module#prepended
//emlist[例][ruby]{
# super と prepend の組み合わせの例
module X
def foo
puts "X1" # (1x)
super # (2x)
puts "X2" # (3x)
end
end
class A
prepend X
def foo
puts "A" #(1a)
end
end
A.new.foo
# (1x) (2x)(こ... -
Module
# prepend _ features(mod) -> self (14137.0) -
Module#prepend から呼び出されるメソッドで、 prepend の処理の実体です。このメソッド自体は mod で指定した モジュール/クラスの継承チェインの先頭に self を追加します。
...Module#prepend から呼び出されるメソッドで、
prepend の処理の実体です。このメソッド自体は mod で指定した
モジュール/クラスの継承チェインの先頭に self を追加します。
このメソッドを上書きすることで、prepend の処理を変......m mod prepend を呼び出したモジュール
@return mod が返されます
//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
Recorde......r::RECORDS # => [A, C]
//}
@see Module#prepend, Module#prepended... -
Object
# extend(*modules) -> self (14137.0) -
引数で指定したモジュールのインスタンスメソッドを self の特異 メソッドとして追加します。
...ス)に機能を追加します
が、extend は、ある特定のオブジェクトだけにモジュールの機能を追加
したいときに使用します。
引数に複数のモジュールを指定した場合、最後
の引数から逆順に extend を行います。
@param modules モ......ule Foo
def a
'ok Foo'
end
end
module Bar
def b
'ok Bar'
end
end
obj = Object.new
obj.extend Foo, Bar
p obj.a #=> "ok Foo"
p obj.b #=> "ok Bar"
class Klass
include Foo
extend Bar
end
p Klass.new.a #=> "ok Foo"
p Klass.b #=> "ok Bar"
//}
extend の機能は、「特異ク......ただしその場合、フック用のメソッド
が Module#extended ではなく Module#included になるという違いがあります。
//emlist[][ruby]{
# obj.extend Foo, Bar とほぼ同じ
class << obj
include Foo, Bar
end
//}
@see Module#extend_object,Module#include,Module#extended... -
Symbol
# end _ with?(*suffixes) -> bool (14132.0) -
self の末尾が suffixes のいずれかであるとき true を返します。
...。
(self.to_s.end_with?と同じです。)
@param suffixes パターンを表す文字列 (のリスト)
@see Symbol#start_with?
@see String#end_with?
//emlist[][ruby]{
:hello.end_with?("ello") #=> true
# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven",......"ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}... -
Object
# send(name , *args) -> object (14125.0) -
オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。
...クもそのまま引き渡します。
send が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。
send, __send__ は、メソッドの呼び出し制限......lic_send を使う方が良いでしょう。
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。
//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"
class Foo
def foo() "foo" end
d......ef bar() "bar" end
def baz() "baz" end
end
# 任意のキーとメソッド(の名前)の関係をハッシュに保持しておく
# レシーバの情報がここにはないことに注意
methods = {1 => :foo,
2 => :bar,
3 => :baz}
# キーを使って関連するメソッドを呼び出... -
Object
# send(name , *args) { . . . . } -> object (14125.0) -
オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。
...クもそのまま引き渡します。
send が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。
send, __send__ は、メソッドの呼び出し制限......lic_send を使う方が良いでしょう。
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。
//emlist[][ruby]{
p -365.send(:abs) #=> 365
p "ruby".send(:sub,/./,"R") #=> "Ruby"
class Foo
def foo() "foo" end
d......ef bar() "bar" end
def baz() "baz" end
end
# 任意のキーとメソッド(の名前)の関係をハッシュに保持しておく
# レシーバの情報がここにはないことに注意
methods = {1 => :foo,
2 => :bar,
3 => :baz}
# キーを使って関連するメソッドを呼び出... -
String
# end _ with?(*strs) -> bool (14120.0) -
self の末尾が strs のいずれかであるとき true を返します。
...ずれかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}
@see String#start_with?......ます。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}
@see String#start_with?
@see String#delete_suffix, String#delete_...