クラス
-
ARGF
. class (198) - Array (74)
- Bignum (6)
- Binding (6)
- Complex (22)
- Data (6)
- Dir (156)
- Encoding (71)
-
Encoding
:: Converter (99) -
Encoding
:: InvalidByteSequenceError (33) -
Encoding
:: UndefinedConversionError (22) -
Enumerator
:: ArithmeticSequence (6) -
Enumerator
:: Chain (6) - Exception (73)
- FalseClass (22)
- Fiber (8)
- File (176)
-
File
:: Stat (22) - Fixnum (6)
- Float (33)
- Hash (99)
- IO (392)
- Integer (69)
- LoadError (11)
- MatchData (143)
- Method (33)
- Module (228)
- NameError (11)
- NilClass (11)
- Numeric (11)
- Object (179)
- Proc (33)
-
Process
:: Status (22) - Random (26)
- Range (34)
- Rational (33)
- Regexp (165)
- RubyVM (22)
-
RubyVM
:: AbstractSyntaxTree :: Node (36) -
RubyVM
:: InstructionSequence (225) - SignalException (11)
- String (1988)
- Struct (137)
- Symbol (147)
- SyntaxError (2)
- Thread (102)
-
Thread
:: Backtrace :: Location (77) - Time (60)
- TracePoint (226)
- TrueClass (22)
- UnboundMethod (33)
- UncaughtThrowError (10)
モジュール
- Enumerable (22)
-
File
:: Constants (22) - GC (33)
-
GC
:: Profiler (11) - Kernel (723)
- Marshal (11)
- ObjectSpace (11)
- Process (77)
-
Process
:: Sys (66) -
RubyVM
:: AbstractSyntaxTree (18) -
RubyVM
:: MJIT (6) - Signal (33)
キーワード
-
$ " (11) -
$ & (11) -
$ & # 39; (11) -
$ * (11) -
$ + (11) -
$ , (11) -
$ -0 (11) -
$ -F (11) -
$ -I (11) -
$ -i (11) -
$ / (11) -
$ 0 (11) -
$ 1 (11) -
$ 10 (11) -
$ 11 (11) -
$ 2 (11) -
$ 3 (11) -
$ 4 (11) -
$ 5 (11) -
$ 6 (11) -
$ 7 (11) -
$ 8 (11) -
$ 9 (11) -
$ : (11) -
$ ; (11) -
$ @ (11) -
$ FILENAME (11) -
$ LOADED _ FEATURES (11) -
$ LOAD _ PATH (11) -
$ PROGRAM _ NAME (11) -
$ \ (11) -
$ _ (11) -
$ ` (11) - % (11)
- * (22)
- + (11)
- +@ (9)
- -@ (9)
- << (11)
- <=> (11)
- == (11)
- === (22)
- =~ (22)
-
CESU
_ 8 (5) - Complex (12)
- EINTR (11)
- ESTRPIPE (11)
- Float (6)
-
INSTRUCTION
_ NAMES (11) - InstructionSequence (11)
- Integer (6)
- Location (11)
- NULL (11)
- OPTS (22)
-
RUBY
_ COPYRIGHT (11) -
RUBY
_ DESCRIPTION (11) -
RUBY
_ ENGINE (11) -
RUBY
_ ENGINE _ VERSION (9) -
RUBY
_ PLATFORM (11) -
RUBY
_ RELEASE _ DATE (11) -
RUBY
_ REVISION (5) -
RUBY
_ VERSION (11) - Rational (6)
- String (22)
- TRUNC (11)
- TracePoint (11)
- WUNTRACED (11)
- WaitReadable (11)
- [] (187)
- []= (77)
-
_ _ dir _ _ (11) -
_ dump (11) - ` (11)
-
absolute
_ path (33) - argv0 (11)
-
ascii
_ only? (11) -
asciicompat
_ encoding (11) - asctime (11)
- attr (24)
-
attr
_ accessor (8) -
attr
_ reader (8) -
attr
_ writer (11) - autoload? (22)
- b (11)
- backtrace (22)
-
backtrace
_ locations (33) -
base
_ label (22) - basename (11)
- binding (11)
- binread (11)
- binwrite (11)
- byteindex (2)
- byterindex (2)
- bytes (39)
- bytesize (11)
- byteslice (33)
- bytesplice (4)
-
callee
_ id (11) - caller (33)
-
caller
_ locations (22) - capitalize (11)
- capitalize! (11)
- captures (11)
- casecmp (11)
- casecmp? (8)
- center (11)
- chars (22)
- children (26)
- chomp (22)
- chomp! (11)
- chop (22)
- chop! (11)
- chr (33)
-
class
_ variables (11) - clear (11)
- codepoints (22)
- compile (22)
-
compile
_ file (11) -
compile
_ option (11) -
compile
_ option= (11) - concat (19)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ source _ location (5) - constants (11)
- convert (11)
-
copy
_ stream (22) - count (11)
- crypt (11)
- ctime (11)
-
deconstruct
_ keys (2) - dedup (2)
-
defined
_ class (11) - delete (33)
- delete! (11)
-
delete
_ prefix (7) -
delete
_ prefix! (7) -
delete
_ suffix (7) -
delete
_ suffix! (7) -
destination
_ encoding _ name (22) - dev (11)
- dig (9)
- dirname (11)
- disable (22)
- disasm (22)
- disassemble (22)
- downcase (11)
- downcase! (11)
- dump (22)
-
each
_ byte (22) -
each
_ char (22) -
each
_ codepoint (22) -
each
_ grapheme _ cluster (14) -
each
_ line (22) -
each
_ pair (22) - empty? (11)
- enable (22)
- enabled? (11)
- encode (33)
- encode! (22)
- encoding (11)
-
end
_ with? (11) - entries (39)
- eql? (11)
-
error
_ bytes (11) -
error
_ char (11) - escape (11)
- eval (11)
-
eval
_ script (6) - event (11)
- exit (22)
- extname (11)
- fail (11)
- fetch (33)
- filename (11)
- filter (12)
- finish (11)
-
first
_ column (6) -
first
_ lineno (17) -
force
_ encoding (11) - format (11)
- ftype (22)
-
garbage
_ collect (22) - getbyte (11)
- getc (22)
- getrlimit (11)
- gets (77)
- getwd (11)
- glob (15)
-
grapheme
_ clusters (14) - gsub (66)
- gsub! (44)
- hash (22)
- hex (11)
- home (22)
- id2name (11)
- include? (11)
- index (18)
-
inplace
_ mode (11) - insert (11)
-
insert
_ output (11) - inspect (361)
-
instance
_ methods (11) -
instruction
_ sequence (6) - integer? (11)
- intern (11)
- join (22)
- key (11)
- keys (11)
-
keyword
_ init? (3) - label (22)
-
last
_ column (6) -
last
_ lineno (6) -
last
_ match (11) - length (22)
- lineno (22)
- lines (22)
- ljust (11)
- load (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) -
locale
_ charmap (11) - lstrip (11)
- lstrip! (11)
- match (44)
- match? (8)
-
method
_ defined? (6) -
method
_ id (11) - methods (11)
-
module
_ function (4) - name (35)
- name= (9)
-
name
_ list (11) -
named
_ captures (11) - names (33)
- new (75)
- next (11)
- next! (11)
- oct (11)
- of (13)
- ord (11)
- pack (19)
- parameters (6)
- parse (8)
-
parse
_ file (8) - partition (11)
- path (92)
- pause (6)
- pipe (22)
-
post
_ match (11) -
pre
_ match (11) - pread (7)
- prepend (19)
- private (8)
-
private
_ instance _ methods (11) -
private
_ method _ defined? (6) -
private
_ methods (11) - protected (4)
-
protected
_ instance _ methods (11) -
protected
_ method _ defined? (6) -
protected
_ methods (11) - public (8)
-
public
_ instance _ methods (11) -
public
_ method _ defined? (6) -
public
_ methods (11) - putback (22)
- pwd (11)
- pwrite (7)
- quote (11)
- raise (27)
-
raised
_ exception (11) -
raw
_ seed (2) - read (66)
-
read
_ nonblock (22) -
readagain
_ bytes (11) - readchar (22)
- readline (77)
- readlines (77)
- readlink (11)
- readpartial (22)
- realdirpath (11)
- realpath (11)
- replace (11)
- replacement (11)
- replacement= (11)
- result (11)
-
return
_ value (11) - reverse (11)
- reverse! (11)
- rindex (11)
- rjust (11)
- rpartition (11)
- rstrip (11)
- rstrip! (11)
- scan (22)
- scrub (33)
- scrub! (33)
- select (22)
- self (11)
-
set
_ backtrace (11) -
set
_ encoding (22) -
set
_ trace _ func (11) - setbyte (11)
- setproctitle (11)
- setregid (11)
- setresgid (11)
- setresuid (11)
- setreuid (11)
- setrgid (11)
- setrlimit (22)
- setruid (11)
- shift (11)
- signame (11)
- signm (11)
-
singleton
_ methods (11) - size (22)
- slice (121)
- slice! (66)
- source (11)
-
source
_ location (39) - split (28)
- sprintf (11)
- squeeze (11)
- squeeze! (11)
- start (11)
-
start
_ with? (11) - stat (10)
- status (11)
- store (11)
- strftime (11)
- string (11)
- strip (11)
- strip! (11)
- sub (55)
- sub! (33)
- succ (11)
- succ! (11)
- sum (11)
- swapcase (11)
- swapcase! (11)
- sysread (11)
- syswrite (11)
-
to
_ a (50) -
to
_ binary (9) -
to
_ c (11) -
to
_ f (11) -
to
_ i (11) -
to
_ path (24) -
to
_ r (11) -
to
_ s (333) -
to
_ str (22) -
to
_ sym (11) - tr! (11)
-
tr
_ s (11) -
tr
_ s! (11) - trace (11)
-
trace
_ var (33) - transfer (3)
-
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - trap (44)
- truncate (66)
-
try
_ convert (58) - undump (7)
-
unicode
_ normalize (10) -
unicode
_ normalize! (10) -
unicode
_ normalized? (10) - unpack (11)
- unpack1 (8)
-
untrace
_ var (11) - upcase (11)
- upcase! (11)
- upto (11)
- urandom (7)
-
valid
_ encoding? (11) - values (11)
-
values
_ at (22) - write (44)
-
write
_ nonblock (11) - zone (11)
検索結果
先頭5件
-
String
# tr(pattern , replace) -> String (32351.0) -
pattern 文字列に含まれる文字を検索し、 それを replace 文字列の対応する文字に置き換えます。
...pattern 文字列に含まれる文字を検索し、
それを replace 文字列の対応する文字に置き換えます。
pattern の形式は tr(1) と同じです。つまり、
`a-c' は a から c を意味し、"^0-9" のように
文字列の先頭が `^' の場合は指定文字以外......える文字
//emlist[例][ruby]{
p "foo".tr("f", "X") # => "Xoo"
p "foo".tr('a-z', 'A-Z') # => "FOO"
p "FOO".tr('A-Z', 'a-z') # => "foo"
# シーザー暗号の復号
p "ORYV".tr("A-Z", "D-ZA-C") # => "RUBY"
# 全角英数字といくつかの記号の半角化
email = "ruby−l......ang@example.com"
p email.tr("0-9a-zA-Z.@−", "0-9a-zA-Z.@-")
# => "ruby-lang@example.com"
//}
@see String#tr!, String#tr_s... -
RubyVM
:: InstructionSequence . load _ from _ binary _ extra _ data(binary) -> String (26502.0) -
バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。
...埋め込まれたextra_dataを取り出します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}
@see RubyVM::InstructionSequence#to_binary... -
Encoding
:: InvalidByteSequenceError # destination _ encoding _ name -> String (26402.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::InvalidByteSequenceError#destination_encoding... -
Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String (26402.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#destination_encoding... -
TracePoint
# binding -> Binding (26402.0) -
発生したイベントによって生成された Binding オブジェクトを返します。
...発生したイベントによって生成された Binding オブジェクトを返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}... -
TracePoint
# binding -> Binding | nil (26402.0) -
発生したイベントによって生成された Binding オブジェクトを返します。
...れた Binding オブジェクトを返します。
C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:......call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (26402.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...script_compiledイベント発生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval......("puts 'hello'")
end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (23402.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if D......aise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:i......n `<main>'"]
//}
@see Exception#backtrace... -
Time
# strftime(format) -> String (23326.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...角空白で埋める ( 1..31)
* %F: %Y-%m-%d と同等 (ISO 8601の日付フォーマット)
* %G: ISO 8601の暦週の年
* %g: ISO 8601の暦週の年の下2桁(00-99)
* %H: 24時間制の時(00-23)
* %h: %b と同等
* %I: 12時間制の時(01-12)
* %j: 年中の通算日(001-366)......後(AM,PM)
* %Q: 1970-01-01 00:00:00 UTC からの経過ミリ秒 (Time#strftime は対応していませんが、Date#strftime で使えます)
* %R: 24時間制の時刻。%H:%M と同等。
* %r: 12時間制の時刻。%I:%M:%S %p と同等。
* %S: 秒(00-60) (60はうるう秒)
* %s:......(\t)
* %U: 週を表す数。最初の日曜日が第1週の始まり(00-53)
* %u: 月曜日を1とした、曜日の数値表現 (1..7)
* %V: ISO 8601形式の暦週 (01..53)
* %v: VMS形式の日付 (%e-%^b-%4Y)
* %W: 週を表す数。最初の月曜日が第1週の始まり(00-53)
*... -
String
# lstrip -> String (23302.0) -
文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v" です。
...頭にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v" です。
//emlist[例][ruby]{
p " abc\n".lstrip #=> "abc\n"
p "\t abc\n".lstrip #=> "abc\n"
p "abc\n".lstrip #=> "abc\n"
//}
@see String#strip, String#rstrip... -
String
# rstrip -> String (23302.0) -
文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...mlist[例][ruby]{
p " abc\n".rstrip #=> " abc"
p " abc \t\r\n\0".rstrip #=> " abc"
p " abc".rstrip #=> " abc"
p " abc\0 ".rstrip #=> " abc"
str = "abc\n"
p str.rstrip #=> "abc"
p str #=> "abc\n" (元の文字列は変化しない)
//}
@see String......#lstrip,String#strip...