クラス
- Array (54)
- BasicObject (143)
- Binding (11)
- Class (22)
- Data (10)
- Dir (2)
-
Encoding
:: Converter (165) -
Encoding
:: InvalidByteSequenceError (11) - Enumerator (110)
- Exception (22)
- Fiber (29)
- File (21)
-
File
:: Stat (66) - Hash (111)
- IO (407)
- KeyError (14)
- Method (105)
- Module (254)
- Mutex (6)
- Numeric (11)
- Object (358)
-
ObjectSpace
:: WeakMap (11) - Random (66)
- Range (34)
- Regexp (44)
- String (22)
- Struct (109)
- Thread (277)
-
Thread
:: Backtrace :: Location (44) -
Thread
:: ConditionVariable (18) -
Thread
:: Mutex (27) -
Thread
:: Queue (27) -
Thread
:: SizedQueue (45) - ThreadGroup (22)
- Time (11)
- TracePoint (106)
- UnboundMethod (21)
モジュール
- Enumerable (132)
キーワード
- ! (11)
- != (11)
- < (11)
- <=> (33)
- == (79)
- === (29)
- [] (44)
- []= (22)
-
_ _ id _ _ (11) -
_ _ send _ _ (22) -
_ dump (11) -
abort
_ on _ exception (11) -
abort
_ on _ exception= (11) -
absolute
_ path (11) - add (11)
-
add
_ trace _ func (11) -
alias
_ method (11) - alive? (11)
- allocate (11)
- atime (11)
-
backtrace
_ locations (33) -
base
_ label (11) - bind (11)
-
bind
_ call (10) - birthtime (10)
- broadcast (9)
- bytes (11)
- call (22)
-
callee
_ id (11) - chmod (11)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ set (11) - close (11)
- closed? (11)
- coerce (11)
- convert (11)
- convpath (11)
- ctime (11)
-
deconstruct
_ keys (2) - default (22)
-
default
_ proc (11) -
define
_ method (22) -
defined
_ class (11) - deq (18)
-
destination
_ encoding (11) - dig (9)
- directory? (11)
- display (11)
- each (110)
-
each
_ char (22) -
each
_ entry (22) -
each
_ line (66) -
each
_ with _ index (22) - enclosed? (11)
- entries (6)
-
enum
_ for (22) - eof (11)
- eof? (11)
- eql? (35)
- equal? (11)
-
error
_ bytes (11) -
eval
_ script (6) - event (11)
- exit (11)
- extend (11)
- extended (11)
- feed (11)
- fetch (7)
- filter (12)
- finish (11)
- getc (11)
- gets (33)
- hash (2)
-
ignore
_ deadlock= (3) - initialize (11)
-
initialize
_ copy (11) -
insert
_ output (11) - inspect (44)
-
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variable _ set (11) -
instance
_ variables (11) -
instruction
_ sequence (6) -
is
_ a? (11) - isatty (11)
- join (22)
- key (7)
- kill (11)
-
kind
_ of? (11) - lineno (22)
- lineno= (11)
-
local
_ variable _ set (11) -
marshal
_ dump (11) -
marshal
_ load (11) - match (22)
- max (44)
- max= (9)
- merge (22)
-
method
_ id (11) -
method
_ missing (11) - methods (11)
- min (44)
-
module
_ eval (22) -
module
_ exec (11) - mtime (11)
- name (11)
- name= (9)
-
next
_ values (11) -
original
_ name (11) - pack (16)
- parameters (17)
- path (11)
-
peek
_ values (11) - pop (18)
- prepend (11)
-
primitive
_ convert (44) -
primitive
_ errinfo (11) - priority (11)
- priority= (11)
- private (23)
- putback (22)
- raise (26)
-
raised
_ exception (11) - rand (33)
- readchar (11)
- readline (33)
- receiver (7)
- refine (11)
-
remove
_ instance _ variable (11) - reopen (33)
- replace (11)
- replacement (11)
- replacement= (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) -
respond
_ to? (11) -
respond
_ to _ missing? (11) - resume (11)
-
return
_ value (11) - rewind (11)
- run (11)
- seek (11)
- select (22)
- send (22)
-
set
_ trace _ func (11) - shift (29)
- shuffle (22)
- signal (9)
-
singleton
_ class (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - size (11)
- sleep (11)
-
source
_ encoding (11) -
source
_ location (11) - status (11)
- stop? (11)
- strftime (11)
- sum (16)
-
super
_ method (10) - symlink? (11)
- sync= (11)
- synchronize (11)
- tainted? (6)
- terminate (11)
-
thread
_ variable _ get (11) -
thread
_ variable _ set (11) -
to
_ a (6) -
to
_ ary (11) -
to
_ enum (22) -
to
_ h (12) -
to
_ int (11) -
to
_ s (44) -
to
_ str (11) - transfer (3)
- tty? (11)
-
undef
_ method (11) - ungetbyte (11)
- ungetc (11)
- unlock (11)
-
values
_ at (22) - wakeup (11)
- with (2)
-
with
_ object (22)
検索結果
先頭5件
-
Class
# new(*args , &block) -> object (18134.0) -
自身のインスタンスを生成して返します。 このメソッドの引数はブロック引数も含め Object#initialize に渡されます。
...引数も含め 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>
//}... -
Array
# pack(template , buffer: String . new) -> String (146.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...。
buffer が指定されていれば、バッファとして使って返値として返します。
もし template の最初にオフセット (@) が指定されていれば、
結果はオフセットの後ろから詰められます。
buffer の元の内容がオフセットより長けれ......す。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックするためのテンプレートを文字列で指定します。
@param buffer 結果を詰めるバッ......jZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWg==".unpack("m0")
# => ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]
//}
@see base64
: M
quoted-printable encoding された文字列
//emlist[][ruby]{
["a b c\td \ne"].pack("M") # => "a b c\td =\n\ne=\n"
"a b c\td =\n... -
Module
# alias _ method(new , original) -> Symbol (134.0) -
メソッドの別名を定義します。
...できません。
@param new 新しいメソッド名。String または Symbol で指定します。
@param original 元のメソッド名。String または Symbol で指定します。
@return 作成したエイリアスのメソッド名を表す Symbol を返します。
@see d:spec/def#al... -
Module
# alias _ method(new , original) -> self (134.0) -
メソッドの別名を定義します。
...して使用することはできません。
@param new 新しいメソッド名。String または Symbol で指定します。
@param original 元のメソッド名。String または Symbol で指定します。
@return self を返します。
@see d:spec/def#alias
//emlist[例][ruby]{
modu... -
Thread
# report _ on _ exception=(newstate) (127.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...レッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.rep......n
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on......_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
IO
# sync=(newstate) (121.0) -
自身を同期モードに設定すると、出力関数の呼出毎にバッファがフラッシュされます。
...自身を同期モードに設定すると、出力関数の呼出毎にバッファがフラッシュされます。
@param newstate 自身を同期モードに設定するかを boolean で指定します。
@raise IOError 既に close されていた場合に発生します。
@see IO#sync... -
Enumerable
# max {|a , b| . . . } -> object | nil (118.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...です。
@param n 取得する要素数。
@raise TypeError ブロックが整数以外を返したときに発生します。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55......),
Person.new("sato", 33),
Person.new("sato", 11),
Person.new("suzuki", 55),
Person.new("suzuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]
# 年齢が最大、名前が最小
people.max { |x, y| (x.age <=> y.age).n......onzero? || y.name <=> x.name }
# => #<Person:0x007fc54b0240a0 @name="sato", @age=55>
people.max(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fc54b0240a0 @name="sato", @age=55>, #<Person:0x007fc54c033ea0 @name="suzuki", @age=55>]
//}... -
Enumerable
# max(n) {|a , b| . . . } -> Array (118.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...です。
@param n 取得する要素数。
@raise TypeError ブロックが整数以外を返したときに発生します。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55......),
Person.new("sato", 33),
Person.new("sato", 11),
Person.new("suzuki", 55),
Person.new("suzuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]
# 年齢が最大、名前が最小
people.max { |x, y| (x.age <=> y.age).n......onzero? || y.name <=> x.name }
# => #<Person:0x007fc54b0240a0 @name="sato", @age=55>
people.max(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fc54b0240a0 @name="sato", @age=55>, #<Person:0x007fc54c033ea0 @name="suzuki", @age=55>]
//}... -
Enumerable
# min {|a , b| . . . } -> object | nil (118.0) -
ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...
@param n 取得する要素数。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),
Person.new("suzuki", 55),
Person.new(......zuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]
# 年齢が最小、名前が最大
people.min { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fd6f0824190 @name="tanaka", @age=11>
people.min(......2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fb5899ef4a8 @name="tanaka", @age=11>, #<Person:0x007fb5899ef728 @name="suzuki", @age=11>]
//}
@raise TypeError ブロックが整数以外を返したときに発生します。... -
Enumerable
# min(n) {|a , b| . . . } -> Array (118.0) -
ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...
@param n 取得する要素数。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),
Person.new("suzuki", 55),
Person.new(......zuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]
# 年齢が最小、名前が最大
people.min { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fd6f0824190 @name="tanaka", @age=11>
people.min(......2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fb5899ef4a8 @name="tanaka", @age=11>, #<Person:0x007fb5899ef728 @name="suzuki", @age=11>]
//}
@raise TypeError ブロックが整数以外を返したときに発生します。... -
Thread
# abort _ on _ exception=(newstate) (115.0) -
真の場合、そのスレッドが例外によって終了した時に、インタプリタ 全体を中断させます。false の場合、あるスレッドで起こった例 外は、Thread#join などで検出されない限りそのスレッ ドだけをなにも警告を出さずに終了させます。
...c:Thread#exceptionを参照してください。
@param newstate 自身を実行中に例外発生した場合、インタプリタ全体を終了させるかどうかを true か false で指定します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.abort_on_exception # => false...