8713件ヒット
[1-100件を表示]
(0.102秒)
クラス
-
ARGF
. class (189) - Array (388)
- BasicObject (77)
- Bignum (63)
- Class (11)
- Complex (104)
- Data (6)
- Dir (365)
- Encoding (143)
-
Encoding
:: Converter (55) -
Encoding
:: UndefinedConversionError (11) - Enumerator (57)
-
Enumerator
:: ArithmeticSequence (84) -
Enumerator
:: Chain (36) -
Enumerator
:: Lazy (72) - Exception (29)
- File (559)
-
File
:: Stat (33) - Fixnum (63)
- Float (41)
- Hash (481)
- IO (570)
- Integer (314)
- KeyError (19)
- LoadError (11)
- MatchData (224)
- Method (108)
- Module (293)
- Mutex (2)
- NilClass (50)
- NoMethodError (25)
- Numeric (161)
- Object (230)
- Proc (11)
-
Process
:: Status (22) - Range (130)
- Rational (132)
- Refinement (3)
- Regexp (66)
-
RubyVM
:: AbstractSyntaxTree :: Node (6) -
RubyVM
:: InstructionSequence (66) - String (860)
- Struct (55)
- Symbol (150)
- SyntaxError (2)
- Thread (489)
-
Thread
:: Backtrace :: Location (77) -
Thread
:: ConditionVariable (36) -
Thread
:: Mutex (18) -
Thread
:: Queue (39) -
Thread
:: SizedQueue (111) - ThreadGroup (11)
- Time (206)
- TracePoint (22)
- UnboundMethod (97)
- UncaughtThrowError (10)
モジュール
- Enumerable (233)
-
File
:: Constants (42) - FileTest (33)
- GC (27)
-
GC
:: Profiler (11) - Kernel (209)
- Marshal (66)
- Math (88)
- ObjectSpace (22)
- Process (77)
-
Process
:: GID (55) -
Process
:: UID (55) -
RubyVM
:: AbstractSyntaxTree (8) - Signal (11)
キーワード
- != (11)
-
$ LOAD _ PATH (11) -
$ ~ (11) - % (45)
- & (39)
- * (39)
- ** (39)
- + (67)
- - (39)
-
/ (38) - < (25)
- << (20)
- <= (25)
- <=> (121)
- == (89)
- === (36)
- =~ (37)
- > (25)
- >= (25)
- ArithmeticSequence (6)
-
BIG5
_ HKSCS (11) -
BIG5
_ HKSCS _ 2008 (11) -
Big5
_ HKSCS (11) -
Big5
_ HKSCS _ 2008 (11) -
CLOCK
_ THREAD _ CPUTIME _ ID (11) - Chain (6)
- ConditionVariable (9)
- DEBUG (11)
- DomainError (11)
- ECHILD (11)
- EHWPOISON (10)
- EMULTIHOP (11)
- EPROGMISMATCH (11)
- ERPCMISMATCH (11)
-
FNM
_ DOTMATCH (11) -
FNM
_ PATHNAME (11) -
LOCK
_ SH (11) - Location (11)
- MACTHAI (11)
- MACTURKISH (11)
-
MAJOR
_ VERSION (11) -
MINOR
_ VERSION (11) -
MUTEX
_ FOR _ THREAD _ EXCLUSIVE (5) - MacThai (11)
- MacTurkish (11)
- NoMatchingPatternError (5)
-
PATH
_ SEPARATOR (11) - PI (11)
-
RUBY
_ COPYRIGHT (11) -
RUBY
_ PATCHLEVEL (11) -
SCRIPT
_ LINES _ _ (11) -
SEEK
_ HOLE (11) -
SHARE
_ DELETE (9) -
SHIFT
_ JIS (11) -
Shift
_ JIS (11) - SizedQueue (9)
- String (11)
-
UTF
_ 8 _ HFS (11) - WNOHANG (11)
- [] (176)
- []= (33)
- ^ (28)
-
_ _ method _ _ (11) -
abort
_ on _ exception (22) -
abort
_ on _ exception= (22) -
absolute
_ path (33) -
absolute
_ path? (5) -
alias
_ method (11) - aliases (11)
- alive? (11)
- angle (11)
- arg (11)
- arity (22)
- asin (11)
- asinh (11)
- assoc (11)
- at (11)
- backtrace (11)
-
backtrace
_ locations (33) -
base
_ label (11) - begin (17)
- bind (11)
-
bind
_ call (10) - binread (11)
- binwrite (11)
- birthtime (31)
-
bit
_ length (17) - blockdev? (11)
- broadcast (9)
- bsearch (44)
-
bsearch
_ index (18) - byteoffset (4)
- bytes (7)
- byteslice (22)
- bytesplice (2)
- caller (11)
-
caller
_ locations (22) - captures (11)
- casecmp (22)
- casecmp? (16)
- catch (22)
- ceildiv (2)
- center (11)
- chain (6)
-
change
_ privilege (22) - chardev? (33)
- chars (36)
- chdir (44)
- children (26)
- chmod (22)
- chomp (22)
- chomp! (11)
- chop (22)
- chop! (11)
- chown (22)
- chr (33)
- chroot (11)
- chunk (11)
-
chunk
_ while (19) -
class
_ variables (11) -
clock
_ gettime (11) - close (9)
- coerce (33)
- collect (12)
- compact! (8)
-
compare
_ by _ identity (11) -
compare
_ by _ identity? (11) - compile (11)
-
compile
_ option (11) - concat (11)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ source _ location (5) - constants (11)
- convpath (11)
-
copy
_ stream (22) - count (11)
- curry (10)
- daemon (11)
-
deconstruct
_ keys (2) - default (22)
-
default
_ proc (11) -
define
_ method (44) -
define
_ singleton _ method (22) - delete (22)
-
delete
_ if (22) - deq (9)
- detach (11)
- difference (6)
- dig (9)
- directory? (11)
- div (28)
- divmod (39)
-
drop
_ while (55) - dump (22)
- each (178)
-
each
_ byte (44) -
each
_ char (66) -
each
_ child (40) -
each
_ codepoint (66) -
each
_ cons (11) -
each
_ grapheme _ cluster (14) -
each
_ index (22) -
each
_ line (132) -
each
_ object (22) -
each
_ pair (66) -
each
_ slice (22) -
each
_ with _ index (22) -
each
_ with _ object (22) - empty? (23)
- end (17)
-
end
_ with? (16) - enq (9)
- entries (22)
-
enum
_ for (22) - eql? (47)
- equal? (11)
-
error
_ char (11) -
exclude
_ end? (6) - exclusive (11)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- exists? (9)
- exit (22)
- fdiv (50)
- fetch (51)
- file? (11)
- fill (22)
- filter (18)
- filter! (12)
- finish (11)
- first (12)
- flush (11)
- fnmatch (11)
- fnmatch? (11)
- foreach (66)
- fork (11)
- format (11)
- frexp (11)
- gamma (11)
- getpriority (11)
- gets (48)
- gm (22)
-
grapheme
_ clusters (14) -
group
_ by (11) - grpowned? (11)
- gsub (33)
- gsub! (22)
-
handle
_ interrupt (11) - hash (165)
- hex (11)
- home (22)
- hour (11)
-
ignore
_ deadlock (3) -
ignore
_ deadlock= (3) -
import
_ methods (3) - include? (33)
- index (7)
- inherited (11)
- insert (22)
-
insert
_ output (11) - inspect (83)
-
instance
_ method (11) -
instance
_ methods (11) - intersect? (3)
- intersection (5)
- invert (22)
- join (22)
-
keep
_ if (22) - key (7)
- kill (22)
- label (11)
- last (12)
-
last
_ match (11) -
latest
_ gc _ info (11) - lchmod (11)
- lchown (11)
- length (93)
- lgamma (11)
- lineno (11)
- lines (16)
- list (33)
- ljust (11)
- load (11)
- local (22)
-
locale
_ charmap (11) - main (11)
- map (12)
-
marshal
_ dump (11) - match (55)
- match? (8)
- max (31)
- max= (9)
-
max
_ by (44) -
method
_ defined? (11) -
method
_ id (11) -
method
_ missing (11) -
method
_ undefined (11) - methods (11)
- min (42)
- minmax (10)
- mkdir (11)
- mktime (22)
- modulo (28)
- month (11)
- name (9)
- name= (9)
- names (11)
- new (165)
-
num
_ waiting (9) - offset (22)
- open (66)
-
original
_ name (22) - owned? (11)
- pack (19)
-
parse
_ file (8) - pass (11)
- path (92)
-
pending
_ interrupt? (22) - permutation (22)
- phase (11)
- pipe? (11)
- polar (11)
- pop (9)
-
post
_ match (11) - pow (22)
-
pre
_ match (11) - prepend (11)
- priority (11)
- priority= (11)
-
private
_ call? (8) -
private
_ class _ method (15) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) -
protected
_ instance _ methods (11) -
protected
_ method _ defined? (11) -
protected
_ methods (11) -
public
_ class _ method (15) -
public
_ instance _ method (11) -
public
_ instance _ methods (11) -
public
_ method (11) -
public
_ method _ defined? (11) -
public
_ methods (11) - push (9)
- putc (11)
- quo (33)
- raise (11)
- rassoc (11)
-
raw
_ data (11) -
re
_ exchange (22) -
re
_ exchangeable? (22) - read (55)
- readable? (11)
-
readable
_ real? (11) - readchar (22)
- readline (24)
- readlines (57)
- readlink (11)
- realdirpath (11)
- realpath (11)
- receiver (18)
- rehash (11)
- reject (22)
- reject! (22)
- remainder (25)
- reopen (22)
- replace (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) - restore (11)
-
reverse
_ each (11) - rewind (6)
- rjust (11)
- rmdir (11)
- round (19)
-
ruby2
_ keywords (5) -
safe
_ level (7) - scrub (33)
- scrub! (33)
-
search
_ convpath (11) - seek (22)
- select (18)
- select! (22)
-
set
_ trace _ func (11) - setgid? (11)
- setpriority (11)
- setuid? (11)
- shift (62)
- signal (9)
- sin (11)
-
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - sinh (11)
- size (116)
- size? (11)
- sleep (9)
- slice (90)
- slice! (33)
-
slice
_ when (21) - socket? (11)
-
source
_ location (22) - split (28)
- sprintf (11)
- squeeze (11)
- squeeze! (11)
- start (11)
-
start
_ with? (16) - stat (11)
- status (11)
- step (30)
- sticky? (11)
- stop (11)
- strftime (11)
- string (11)
- sub (33)
- sub! (22)
-
super
_ method (20) - switch (44)
- symlink? (11)
- synchronize (11)
- syscall (11)
- sysopen (11)
- sysseek (11)
-
take
_ while (66) - terminate (11)
-
thread
_ variable? (11) -
thread
_ variable _ get (11) -
thread
_ variable _ set (11) - throw (11)
- thursday? (11)
-
to
_ a (22) -
to
_ enum (22) -
to
_ h (28) -
to
_ path (24) -
to
_ s (83) -
trace
_ var (22) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - truncate (22)
-
try
_ convert (11) - unbind (11)
- ungetc (11)
- union (6)
- unlink (11)
- unpack (11)
- unshift (11)
-
untrace
_ var (11) - utc (22)
-
values
_ at (11) -
verify
_ compaction _ references (5) - wait (9)
- with (2)
-
with
_ index (32) -
with
_ object (22) -
world
_ readable? (22) -
world
_ writable? (22) - writable? (11)
-
writable
_ real? (11) - write (22)
-
yield
_ self (12) - zero? (11)
- | (28)
検索結果
先頭5件
-
Object
# define _ singleton _ method(symbol , method) -> Symbol (18426.0) -
self に特異メソッド name を定義します。
...m symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class <<......self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (18414.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ith_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].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... -
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (18326.0) -
self に特異メソッド name を定義します。
...m symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class <<......self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Enumerable
# each _ with _ index(*args) -> Enumerator (18314.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ith_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].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 _ object(obj) -> Enumerator (18314.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
...返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object... -
Enumerable
# each _ with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (18314.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
...返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object... -
BasicObject
# singleton _ method _ undefined(name) -> object (15302.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...thod または
undef により未定義にされた時にインタプリタから呼び出されます。
通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。
@param name 未定義にされたメソッド名が Symbol で渡されます。
//emli......def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end
obj = Foo.new
def obj.foo
end
def obj.bar
end
class << obj
undef_method :foo
end
obj.instance_eval {undef bar}
#=> singleton method "foo" was undefined
# singleton method "bar" was undefined
/....../}
@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef... -
Encoding
:: Converter # finish -> String (15302.0) -
変換処理を終了し、結果文字列の末尾を返します。 変換元の文字列の末尾がバイト列の途中で終わっていた場合、保持しているバイト列全てを返します。
...末尾
@raise Encoding::InvalidByteSequenceError 変換元のエンコーディングにお
いて不正なバイト列があった場合に発生します。
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
p ec.convert("\u3042") #=> "\e$B$\""
p ec.finish... -
String
# each _ codepoint {|codepoint| block } -> self (15302.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints... -
String
# each _ line(rs = $ / ) {|line| . . . } -> self (15302.0) -
文字列中の各行に対して繰り返します。 行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。 各 line には区切りの文字列も含みます。
...す。
行の区切りは rs に指定した文字列で、
そのデフォルト値は変数 $/ の値です。
各 line には区切りの文字列も含みます。
rs に nil を指定すると行区切りなしとみなします。
rs に空文字列 "" を指定すると「パラグラフモ......列
//emlist[例][ruby]{
"aa\nbb\ncc\n".each_line do |line|
p line
end
# => "aa\n"
# => "bb\n"
# => "cc\n"
p "aa\nbb\ncc\n".lines.to_a # => ["aa\n", "bb\n", "cc\n"]
p "aa\n".lines.to_a # => ["aa\n"]
p "".lines.to_a # => []
s = "aa\nbb\ncc\n"
p s.lines("\n").......to_a #=> ["aa\n", "bb\n", "cc\n"]
p s.lines("bb").to_a #=> ["aa\nbb", "\ncc\n"]
//}
@see String#lines...