るりまサーチ

最速Rubyリファレンスマニュアル検索!
318件ヒット [1-100件を表示] (0.241秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

<< 1 2 3 ... > >>

Regexp#source -> String (26109.0)

その正規表現のもととなった文字列表現を生成して返します。

...その正規表現のもととなった文字列表現を生成して返します。

//emlist[例][ruby]{
re = /foo|bar|baz/i
p re.source # => "foo|bar|baz"
//}...

Module#const_source_location(name, inherited = true) -> [String, Integer] (14169.0)

name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。

..._source_location('C4') # => ["test.rb", 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_...
...

p Object.const_source_location('B') # => ["test.rb", 10] -- Object はトップレベルの定数を検索する
p Object.const_source_location('A') # => ["test.rb", 1] -- クラスが再定義された場合は最初の定義位置を返す

p B.const_source_location('A')...
...る為
p M.const_source_location('A') # => ["test.rb", 1] -- Object は継承していないが追加で modules をチェックする

p Object.const_source_location('A::C1') # => ["test.rb", 2] -- ネストの指定もサポートしている
p Object.const_source_location('String')...

Proc#source_location -> [String, Integer] | nil (14133.0)

ソースコードのファイル名と行番号を配列で返します。

...by]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ["(eval)", 1]
method(:p).to_proc.source_location # => nil
//}

@see Method#source_location...

UnboundMethod#source_location -> [String, Integer] | nil (14127.0)

ソースコードのファイル名と行番号を配列で返します。

...nil を返します。

//emlist[例][ruby]{
require 'time'

Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}

@see Proc#source_location, Method#source_location...

Method#source_location -> [String, Integer] | nil (14121.0)

ソースコードのファイル名と行番号を配列で返します。

...す。

@see Proc#source_location

//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----

require '/tmp/foo'

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]

method(:puts).source_location # => nil...

絞り込み条件を変える

Binding#source_location -> [String, Integer] (14109.0)

self の Ruby のソースファイル名と行番号を返します。

...self の Ruby のソースファイル名と行番号を返します。

d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。

//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}...

Encoding::Converter#source_encoding -> Encoding (14109.0)

変換元のエンコーディングを返します。

...変換元のエンコーディングを返します。

@return 変換元のエンコーディング

//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "euc-jp")
ec.source_encoding #=> #<Encoding:UTF-8>
//}...

Encoding::InvalidByteSequenceError#source_encoding -> Encoding (14109.0)

エラーを発生させた変換の変換元のエンコーディングを Encoding オブジェクトで返します。

...エラーを発生させた変換の変換元のエンコーディングを Encoding
オブジェクトで返します。

@see Encoding::InvalidByteSequenceError#destination_encoding,
Encoding::UndefinedConversionError#source_encoding...

Encoding::InvalidByteSequenceError#source_encoding_name -> Encoding (14109.0)

エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

...エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

@see Encoding::InvalidByteSequenceError#source_encoding...

Encoding::UndefinedConversionError#source_encoding_name -> Encoding (14109.0)

エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

...エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#source_encoding...

絞り込み条件を変える

Encoding::UndefinedConversionError#source_encoding -> Encoding (14103.0)

エラーを発生させた変換の変換元のエンコーディングを Encoding オブジェクトで返します。

エラーを発生させた変換の変換元のエンコーディングを Encoding
オブジェクトで返します。

変換が多段階になされる場合は元の文字列のものではない
エンコーディングが返される場合があることに注意してください。

@see Encoding::UndefinedConversionError#destination_encoding
<< 1 2 3 ... > >>