クラス
-
ARGF
. class (108) - Array (81)
- Binding (7)
- Class (12)
- Complex (24)
- Data (12)
- Dir (55)
- Encoding (48)
-
Encoding
:: Converter (84) -
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) - Exception (80)
- FalseClass (24)
- Fiber (10)
- File (36)
-
File
:: Stat (24) - Float (36)
- Hash (100)
- IO (82)
- Integer (72)
- MatchData (160)
- Method (36)
- Module (288)
- Mutex (2)
- NilClass (12)
- Numeric (12)
- Object (99)
- Proc (36)
- Random (12)
- Range (38)
- Rational (36)
- Regexp (117)
-
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (130) - Set (9)
- SignalException (12)
- String (2107)
- Struct (283)
- Symbol (5)
- Thread (90)
-
Thread
:: Backtrace :: Location (84) -
Thread
:: Mutex (10) - Time (68)
- TracePoint (201)
- TrueClass (60)
- UnboundMethod (36)
- UncaughtThrowError (11)
モジュール
- Enumerable (48)
- GC (12)
キーワード
- % (12)
- & (12)
- * (24)
- + (12)
- +@ (10)
- -@ (10)
- << (12)
- <=> (12)
- == (24)
- === (24)
- =~ (24)
- [] (132)
- []= (96)
- ^ (12)
-
_ dump (12) -
_ load (12) -
absolute
_ path (24) -
add
_ trace _ func (12) -
append
_ as _ bytes (1) - asctime (12)
- attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - autoload? (12)
- b (12)
- backtrace (24)
-
backtrace
_ locations (36) -
base
_ label (24) - binding (12)
- byteindex (3)
- byterindex (3)
- bytes (36)
- bytesize (12)
- byteslice (36)
-
callee
_ id (12) - capitalize (12)
- capitalize! (12)
- captures (12)
- casecmp (12)
- casecmp? (9)
- center (12)
- chars (24)
- children (14)
- chomp (12)
- chomp! (12)
- chop (12)
- chop! (12)
- chr (36)
-
class
_ variables (12) - clear (12)
- codepoints (24)
- concat (21)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (12)
- convert (12)
- count (12)
- crypt (12)
- ctime (12)
- deconstruct (11)
-
deconstruct
_ keys (13) - dedup (3)
-
defined
_ class (12) - delete (12)
- delete! (12)
-
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) - dev (12)
- dig (10)
- disable (24)
- disasm (12)
- disassemble (12)
- downcase (12)
- downcase! (12)
- dump (12)
- each (24)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ grapheme _ cluster (16) -
each
_ line (24) -
each
_ pair (24) - empty? (12)
- enable (24)
- encode (36)
- encode! (24)
- encoding (12)
-
end
_ with? (12) - entries (19)
- eql? (24)
-
error
_ bytes (12) -
error
_ char (12) - eval (12)
-
eval
_ script (7) - event (12)
- filename (12)
- filter (14)
- finish (12)
-
first
_ column (7) -
first
_ lineno (19) -
force
_ encoding (12) - ftype (12)
-
garbage
_ collect (12) - getbyte (12)
- getc (12)
- gets (36)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
- hash (24)
- hex (12)
- include? (12)
- index (12)
-
inplace
_ mode (12) - insert (12)
-
insert
_ output (12) - inspect (319)
-
instance
_ methods (12) -
instruction
_ sequence (7) - integer? (12)
- intern (12)
- join (12)
- label (24)
-
last
_ column (7) -
last
_ lineno (7) - length (24)
- lineno (24)
- lines (24)
- ljust (12)
- lstrip (12)
- lstrip! (12)
- match (48)
- match? (18)
- members (12)
-
method
_ defined? (12) -
method
_ id (12) - methods (12)
-
module
_ function (12) - name (29)
- name= (10)
-
named
_ captures (12) - names (36)
- next (12)
- next! (12)
- oct (12)
- ord (12)
- pack (21)
- parameters (7)
- partition (12)
- path (75)
-
post
_ match (12) -
pre
_ match (12) - pread (8)
- prepend (21)
- private (12)
-
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) - public (12)
-
public
_ method _ defined? (12) - putback (24)
- pwrite (8)
- raise (6)
-
raised
_ exception (12) - read (24)
- readchar (12)
- readlines (36)
- replace (12)
- replacement (12)
- replacement= (12)
-
return
_ value (12) - reverse (12)
- reverse! (12)
- rindex (12)
- rjust (12)
- rpartition (12)
- rstrip (12)
- rstrip! (12)
- scan (24)
- scrub (36)
- scrub! (36)
- select (24)
- self (12)
-
set
_ backtrace (12) -
set
_ trace _ func (12) - setbyte (12)
- signm (12)
-
singleton
_ methods (12) - size (24)
- slice (72)
- slice! (72)
- source (12)
-
source
_ location (43) - split (19)
- squeeze (12)
- squeeze! (12)
-
start
_ with? (12) - strftime (12)
- string (12)
- strip (12)
- strip! (12)
- sub (36)
- sub! (36)
- subtract (3)
- succ (12)
- succ! (12)
- sum (12)
- swapcase (12)
- swapcase! (12)
- syswrite (12)
-
to
_ a (55) -
to
_ binary (10) -
to
_ c (12) -
to
_ f (12) -
to
_ h (19) -
to
_ i (12) -
to
_ path (27) -
to
_ r (12) -
to
_ s (301) -
to
_ str (24) -
to
_ sym (12) -
tr
_ s (12) -
tr
_ s! (12) - transfer (4)
-
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - transpose (12)
- truncate (60)
- trust (9)
-
try
_ lock (12) - type (7)
- undump (8)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unpack (12)
- unpack1 (9)
- untrust (9)
- untrusted? (9)
- upcase (12)
- upcase! (12)
- upto (12)
-
valid
_ encoding? (12) - values (12)
-
values
_ at (24) - write (12)
- zone (12)
- | (12)
検索結果
先頭5件
-
String
# tr(pattern , replace) -> String (27376.0) -
pattern 文字列に含まれる文字を検索し、 それを replace 文字列の対応する文字に置き換えます。
...pattern 文字列に含まれる文字を検索し、
それを replace 文字列の対応する文字に置き換えます。
pattern の形式は tr(1) と同じです。つまり、
`a-c' は a から c を意味し、"^0-9" のように
文字列の先頭が `^' の場合は指定文字以外......が置換の対象になります。
replace に対しても `-' による範囲指定が可能です。
`-' は文字列の両端にない場合にだけ範囲指定の意味になります。
`^' も文字列の先頭にあるときにだけ否定の効果を発揮します。
また、`-', `^',......
replace の範囲が pattern の範囲よりも小さい場合は、
replace の最後の文字が無限に続くものとして扱われます。
@param pattern 置き換える文字のパターン
@param replace pattern で指定した文字を置き換える文字
//emlist[例][ruby]{
p... -
String
# strip -> String (18431.0) -
文字列先頭と末尾の空白文字を全て取り除いた文字列を生成して返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc \r\n".strip #=> "abc"
p "abc\n".strip #=> "abc"
p " abc".strip #=> "abc"
p "abc".strip #=> "abc"
p " \0 abc \0".strip #=> "abc"
str = "\tabc\n"
p str.strip #=> "abc"
p str......#=> "\tabc\n" (元の文字列は変化しない)
//}
@see String#lstrip, String#rstrip... -
String
# lstrip -> String (18425.0) -
文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v\0" です。
//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 (18331.0) -
文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][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... -
String
# rstrip! -> self | nil (18231.0) -
文字列の末尾にある空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...的に取り除きます。
空白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
str = " abc\n"
p str.rstrip! # => " abc"
p str # => " abc"
str = " abc \r\n\t\v\0"
p str.rstrip! # => " abc"
p str # => " abc"
//}
@see String#rstrip, String#lstrip... -
String
# strip! -> self | nil (18231.0) -
先頭と末尾の空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...\t\r\n\f\v\0" です。
strip! は、内容を変更した self を返します。
ただし取り除く空白がなかったときは nil を返します。
//emlist[例][ruby]{
str = " abc\r\n"
p str.strip! #=> "abc"
p str #=> "abc"
str = "abc"
p str.strip! #=> nil
p str......#=> "abc"
str = " \0 abc \0"
str.strip!
p str #=> "abc"
//}
@see String#strip, String#lstrip... -
String
# lstrip! -> self | nil (18225.0) -
文字列の先頭にある空白文字を全て破壊的に取り除きます。 空白文字の定義は " \t\r\n\f\v\0" です。
...は " \t\r\n\f\v\0" です。
lstrip! は self を変更して返します。
ただし取り除く空白がなかったときは nil を返します。
//emlist[例][ruby]{
str = " abc"
p str.lstrip! # => "abc"
p str # => "abc"
str = "abc"
p str.lstrip! # => nil
p str #... -
Struct
# deconstruct -> [object] (18209.0) -
構造体のメンバの値を配列にいれて返します。
...にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに......対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (18209.0) -
self のメンバの名前と値の組を Hash で返します。
...@param array_of_names 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
h = joe.deconstruct_......, :address])
h # => {:zip=>12345, :address=>"123 Maple, Anytown NC"}
# 引数が nil の場合は全てのメンバを返します。
h = joe.deconstruct_keys(nil)
h # => {:name=>"Joseph Smith, Jr.", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}
[注意] 本メソッドの記述は Struct......の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (15609.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 イベントのための
イベントフックの外側で実行した場合に発生します。...