クラス
-
ARGF
. class (36) - Binding (7)
-
Encoding
:: Converter (96) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (24) - Exception (68)
- IO (24)
- MatchData (2)
- Method (12)
- Module (156)
- Object (84)
- Proc (12)
- Rational (24)
-
RubyVM
:: InstructionSequence (94) - SignalException (12)
- String (204)
- Symbol (36)
-
Thread
:: Backtrace :: Location (72) - Time (24)
- UnboundMethod (24)
キーワード
- === (12)
-
absolute
_ path (24) -
ascii
_ only? (12) - autoload (12)
- autoload? (12)
- backtrace (12)
-
base
_ label (24) - byteindex (3)
- capitalize (18)
- capitalize! (9)
- clone (24)
- concat (21)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - convert (12)
- deconstruct (2)
-
define
_ singleton _ method (24) -
deprecate
_ constant (12) -
destination
_ encoding _ name (24) - disasm (12)
- disassemble (12)
- downcase (18)
- downcase! (9)
- dup (12)
- encode (36)
- encode! (24)
-
error
_ bytes (12) -
error
_ char (12) - finish (12)
-
insert
_ output (12) - inspect (60)
- label (24)
-
module
_ function (36) - partition (12)
- path (24)
-
private
_ constant (12) -
public
_ constant (12) - putback (24)
-
read
_ nonblock (24) -
remove
_ const (12) - replacement (12)
- replacement= (12)
- rpartition (12)
-
set
_ backtrace (12) -
set
_ encoding (24) - signm (12)
-
singleton
_ class (12) -
singleton
_ method (12) -
source
_ location (43) - strftime (12)
- swapcase (18)
- swapcase! (9)
-
to
_ binary (10) -
to
_ r (12) -
to
_ s (36) - upcase (18)
- upcase! (9)
-
write
_ nonblock (12) - zone (12)
検索結果
先頭5件
-
String
# partition(sep) -> [String , String , String] (24618.0) -
セパレータ sep が最初に登場する部分で self を 3 つに分割し、 [最初のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。
...@param sep セパレータを表す文字列か正規表現を指定します。
//emlist[例][ruby]{
p "axaxa".partition("x") # => ["a", "x", "axa"]
p "aaaaa".partition("x") # => ["aaaaa", "", ""]
p "aaaaa".partition("") # => ["", "", "aaaaa"]
//}
@see String#rpartition, String#split... -
String
# rpartition(sep) -> [String , String , String] (24618.0) -
セパレータ sep が最後に登場する部分で self を 3 つに分割し、 [最後のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。
...と第 2 要素が空文字列になります。
@param sep セパレータを表す文字列か正規表現を指定します。
//emlist[例][ruby]{
p "axaxa".rpartition("x") # => ["axa", "x", "a"]
p "aaaaa".rpartition("x") # => ["", "", "aaaaa"]
//}
@see String#partition, String#split... -
Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String (24404.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#destination_encoding... -
Module
# const _ source _ location(name , inherited = true) -> [String , Integer] (18416.0) -
name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。
...@param name Symbol,String で定数の名前を指定します。
@param inherited true を指定するとスーパークラスや include したモジュールで定義された定数が対象にはなります。false を指定した場合 対象にはなりません。
@return ソースコー......st[例][ruby]{
# test.rb:
class A # line 1
C1 = 1
C2 = 2
end
module M # line 6
C3 = 3
end
class B < A # line 10
include M
C4 = 4
end
class A # 継続して A を定義する
C2 = 8 # 定数を再定義する
end
p B.const_source_location('C4') # => ["test......", 12]
p B.const_source_location('C3') # => ["test.rb", 7]
p B.const_source_location('C1') # => ["test.rb", 2]
p B.const_source_location('C3', false) # => nil -- include したモジュールは検索しない
p A.const_source_location('C2') # => ["test.rb", 16] -... -
String
# concat(*arguments) -> self (18210.0) -
self に複数の文字列を破壊的に連結します。
...は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # =>......"foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}
@see String#append_as_bytes... -
String
# concat(other) -> self (18210.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...other を破壊的に連結します。
other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
self を返します。
@param other 文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "str......ingXXX"
str << "YYY"
p str # => "stringXXXYYY"
str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}... -
String
# concat(*arguments) -> self (18204.0) -
self に複数の文字列を破壊的に連結します。
...は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # =>......"foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}... -
String
# ascii _ only? -> bool (18103.0) -
文字列がASCII文字のみで構成されている場合に true を返します。さもなくば false を返します。
...字列がASCII文字のみで構成されている場合に true を返します。さもなくば
false を返します。
例:
'abc123'.ascii_only? # => true
''.ascii_only? # => true
'日本語'.ascii_only? # => false
'日本語abc123'.ascii_only? # => false... -
Encoding
:: Converter # convert(source _ string) -> String (15411.0) -
与えられた文字列を変換して、変換できた結果を返します。 引数の末尾の文字がバイト列の途中で終わっている場合、そのバイト列は変換器内に取り置かれます。 変換を終了させるには Encoding::Converter#finish を呼びます。
...Converter#finish を呼びます。
Encoding::Converter を用いると、文字列の一部または全部を渡して変換を行うことができます。よって、不正なバイトを意識せずにストリームから読み出した文字列を変換したいときには Encoding::Convert......onverter#convert では、これらの例外を捕獲しても、例外を起こしたところから変換を再開することはできません。不正なバイトや変換先で未定義な文字をエスケープしたい場合やさらに細かい指定を行いたい場合は、Encoding::Con......verter#primitive_convert を用います。
@param source_string 変換する文字列の一部または全部です。
@return 変換結果である文字列の一部または全部です。
@raise Encoding::InvalidByteSequenceError 変換元のエンコーディングにおいて不正なバイ... -
Encoding
:: InvalidByteSequenceError # destination _ encoding _ name -> String (15404.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::InvalidByteSequenceError#destination_encoding...