6032件ヒット
[3701-3800件を表示]
(0.271秒)
クラス
- Array (87)
- BasicObject (143)
- Binding (11)
- Class (44)
- Data (34)
- Dir (77)
-
Encoding
:: Converter (220) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (11) - Enumerator (155)
-
Enumerator
:: Chain (6) -
Enumerator
:: Lazy (11) -
Enumerator
:: Yielder (27) -
Errno
:: EXXX (22) - Exception (44)
- Fiber (57)
- File (98)
-
File
:: Stat (440) - FrozenError (12)
- Hash (171)
- IO (708)
- KeyError (38)
- LocalJumpError (22)
- Method (182)
- Module (276)
- Mutex (14)
- NameError (26)
- NoMethodError (17)
- Numeric (11)
- Object (402)
-
ObjectSpace
:: WeakMap (11) - Proc (51)
- Random (110)
- Range (45)
- Regexp (88)
-
RubyVM
:: InstructionSequence (33) - SignalException (33)
- StopIteration (11)
- String (50)
- Struct (316)
- SystemCallError (44)
- SystemExit (22)
- Thread (451)
-
Thread
:: Backtrace :: Location (44) -
Thread
:: ConditionVariable (27) -
Thread
:: Mutex (63) -
Thread
:: Queue (102) -
Thread
:: SizedQueue (63) - ThreadGroup (44)
- Time (58)
- TracePoint (150)
- UnboundMethod (21)
モジュール
- Enumerable (132)
-
GC
:: Profiler (11) - Kernel (273)
- Marshal (44)
- ObjectSpace (77)
オブジェクト
- ENV (25)
キーワード
- ! (11)
- != (11)
-
$ stdin (11) - < (11)
- << (11)
- <=> (33)
- == (79)
- === (40)
- ArgumentError (11)
- BasicObject (11)
- Complex (22)
- ConditionVariable (9)
- Data (8)
- EXXX (11)
- Enumerator (11)
- Fiber (11)
- Float (11)
- Integer (11)
- Location (11)
-
MAJOR
_ VERSION (11) -
MINOR
_ VERSION (11) - Method (11)
- Proc (11)
- Queue (9)
- Range (11)
- Rational (22)
- Regexp (11)
- SizedQueue (9)
- Stat (11)
- String (11)
- Struct (11)
- Symbol (1)
- Thread (11)
- ThreadGroup (11)
- TracePoint (11)
- UnboundMethod (11)
- UndefinedConversionError (11)
- Yielder (11)
- [] (81)
- []= (33)
-
_ _ id _ _ (11) -
_ _ send _ _ (22) -
_ dump (11) - abort (22)
-
abort
_ on _ exception (11) -
abort
_ on _ exception= (22) -
absolute
_ path (11) - add (11)
-
add
_ trace _ func (11) -
alias
_ method (11) - alive? (14)
- allocate (11)
- arity (11)
- atime (11)
- backtrace (11)
-
backtrace
_ locations (33) -
base
_ label (11) - bind (11)
-
bind
_ call (10) - binding (11)
- birthtime (10)
- blksize (11)
- blockdev? (11)
- blocks (11)
- broadcast (9)
- bytes (11)
- call (22)
-
callee
_ id (11) - casefold? (11)
- chardev? (11)
- chmod (11)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ set (11) - clear (20)
- clone (11)
- close (29)
- closed? (20)
- coerce (11)
- compile (22)
-
compile
_ option= (11) - convert (11)
- convpath (11)
- ctime (11)
- current (3)
- deconstruct (2)
-
deconstruct
_ keys (2) - default (22)
-
default
_ proc (11) - define (4)
-
define
_ finalizer (22) -
define
_ method (22) -
defined
_ class (11) - deq (18)
-
destination
_ encoding (11) - dev (11)
-
dev
_ major (11) -
dev
_ minor (11) - dig (9)
- directory? (11)
- display (11)
- dump (22)
- dup (3)
- each (132)
-
each
_ char (22) -
each
_ entry (22) -
each
_ line (66) -
each
_ object (44) -
each
_ pair (22) -
each
_ with _ index (22) - empty? (9)
- enclose (11)
- enclosed? (11)
- entries (6)
-
enum
_ for (22) - eof (11)
- eof? (11)
- eql? (35)
- equal? (11)
-
error
_ bytes (11) -
error
_ char (11) -
eval
_ script (6) - event (11)
- exception (11)
- executable? (11)
-
executable
_ real? (11) - exit (11)
-
exit
_ value (11) - extend (11)
- extended (11)
- fail (33)
- feed (11)
- fetch (7)
- file? (11)
- filter (12)
- finish (11)
-
for
_ fd (11) - fork (11)
- ftype (11)
- getbyte (11)
- getc (11)
- gets (33)
- gid (11)
- grpowned? (11)
-
handle
_ interrupt (11) - hash (13)
-
ignore
_ deadlock= (4) -
incomplete
_ input? (11) - initialize (11)
-
initialize
_ copy (11) - ino (11)
-
insert
_ output (11) - inspect (90)
-
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)
-
keyword
_ init? (3) - kill (22)
-
kind
_ of? (11) - lambda (17)
- lambda? (11)
-
last
_ error (11) - length (20)
- lineno (22)
- lineno= (11)
- link (11)
- list (11)
-
local
_ variable _ set (11) - locked? (11)
- loop (18)
-
marshal
_ dump (22) -
marshal
_ load (11) - match (22)
- max (53)
- max= (9)
- members (24)
- merge (22)
-
method
_ id (11) -
method
_ missing (11) - methods (11)
- min (44)
- mode (11)
-
module
_ eval (22) -
module
_ exec (11) - mtime (11)
- name (22)
- name= (9)
-
new
_ seed (11) -
next
_ values (11) - nlink (11)
- now (11)
-
num
_ waiting (9) - open (88)
-
original
_ name (11) - owned? (22)
- owner (11)
- pack (16)
- parameters (17)
- pass (11)
- path (24)
-
peek
_ values (11) -
pending
_ interrupt? (11) - pipe (88)
- pipe? (11)
- pop (18)
- popen (154)
- prepend (11)
-
primitive
_ convert (44) -
primitive
_ errinfo (11) - priority (11)
- priority= (11)
- private (23)
- proc (18)
- produce (5)
- putback (22)
- raise (59)
-
raised
_ exception (11) - rand (33)
- rdev (11)
-
rdev
_ major (11) -
rdev
_ minor (11) - readable? (11)
-
readable
_ real? (11) - readchar (11)
- readline (33)
- reason (11)
- receiver (27)
- refine (11)
-
remove
_ instance _ variable (11) - reopen (33)
- replace (11)
- replacement (11)
- replacement= (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) -
respond
_ to? (11) -
respond
_ to _ missing? (11) - result (22)
- resume (11)
-
return
_ value (11) - rewind (11)
- run (11)
-
safe
_ level (7) -
search
_ convpath (11) - seed (11)
- seek (11)
- select (22)
- send (22)
-
set
_ trace _ func (11) - setgid? (11)
- setuid? (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 (42)
- size? (11)
- sleep (33)
- socket? (11)
-
source
_ encoding (11) -
source
_ location (11) - start (11)
- status (22)
- sticky? (11)
- stop (11)
- stop? (11)
- store (11)
- strftime (11)
- sum (16)
-
super
_ method (10) - symlink (11)
- symlink? (11)
- sync= (11)
- synchronize (11)
- tainted? (6)
- terminate (11)
-
thread
_ variable _ get (11) -
thread
_ variable _ set (11) -
to
_ a (17) -
to
_ ary (11) -
to
_ enum (22) -
to
_ h (38) -
to
_ hash (11) -
to
_ int (11) -
to
_ path (2) -
to
_ proc (27) -
to
_ regexp (11) -
to
_ s (75) -
to
_ str (11) - trace (11)
-
trace
_ var (33) - transfer (3)
-
try
_ lock (11) - tty? (11)
- uid (11)
- unbind (11)
-
undef
_ method (11) -
undefine
_ finalizer (11) - ungetbyte (11)
- ungetc (11)
- unlock (11)
- utime (11)
- value (11)
- values (11)
-
values
_ at (22) - wakeup (11)
- wday (11)
- with (2)
-
with
_ index (22) -
with
_ object (22) - writable? (11)
-
writable
_ real? (11) - yield (22)
- zero? (11)
検索結果
先頭5件
-
Encoding
:: UndefinedConversionError (8008.0) -
エンコーディング変換後の文字が存在しない場合に発生する例外。
...、
例外オブジェクトが保持するエラー情報はその中間のものになります。
//emlist[例][ruby]{
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
# ISO-8859-1 -> UTF-8 -> EUC-JP
begin
ec.convert("\xa0")
# NO-BREAK SPACE, which is available in UTF-8 but not in EUC-JP... -
Encoding
:: UndefinedConversionError # error _ char -> String (8008.0) -
エラーを発生させた1文字を文字列で返します。
...エラーを発生させた1文字を文字列で返します。
//emlist[例][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
begin
ec.convert("\u{a0}")
rescue Encoding::UndefinedConversionError
puts $!.error_char.dump #=> "\u{a0}"
end
//}... -
Enumerable
# each _ entry -> Enumerator (8008.0) -
ブロックを各要素に一度ずつ適用します。
...クには配列として渡されます。
//emlist[例][ruby]{
class Foo
include Enumerable
def each
yield 1
yield 1,2
end
end
Foo.new.each_entry{|o| print o, " -- "}
# => 1 -- [1, 2] --
//}
ブロックを省略した場合は Enumerator が返されます。
@see Enumerable#slice... -
Enumerable
# each _ entry {|obj| block} -> self (8008.0) -
ブロックを各要素に一度ずつ適用します。
...クには配列として渡されます。
//emlist[例][ruby]{
class Foo
include Enumerable
def each
yield 1
yield 1,2
end
end
Foo.new.each_entry{|o| print o, " -- "}
# => 1 -- [1, 2] --
//}
ブロックを省略した場合は Enumerator が返されます。
@see Enumerable#slice... -
Enumerable
# each _ with _ index(*args) -> Enumerator (8008.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (8008.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerator
# feed(obj) -> nil (8008.0) -
Enumerator 内部の yield が返す値を設定します。
...の値は内部で yield された時点でクリアされます。
//emlist[例][ruby]{
# (1), (2), ... (10) の順に実行される
o = Object.new
def o.each
x = yield # (2) blocks
p x # (5) => "foo"
x = yield # (6) blocks
p x # (8) => nil
x... -
Enumerator
# next _ values -> Array (8008.0) -
「次」のオブジェクトを配列で返します。
...ニズムが副作用を
伴っている場合には影響があり得ます。
//emlist[例: next と next_values の違いを][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
yield nil
yield [1, 2]
end
e = o.to_enum
p e.next_values
p e.next_values
p e.next_values
p e.next_valu... -
Enumerator
# peek _ values -> Array (8008.0) -
Enumerator#next_values のように「次」のオブジェクトを 配列で返しますが、列挙状態を変化させません。
...のメソッドは Enumerator#next_values と同様
yield
と
yield nil
を区別するために使えます。
//emlist[例][ruby]{
o = Object.new
def o.each
yield
yield 1
yield 1, 2
end
e = o.to_enum
p e.peek_values #=> []
e.next
p e.peek_values #=> [1]
p e.peek_values #=> [1]... -
Enumerator
# with _ object(obj) -> Enumerator (8008.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...し、
最後に obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_object("foo")
to_three_with_string.each do |x,string|
puts "#{...