るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub

検索結果

<< 1 2 3 ... > >>

JSON::Parser#source -> String (21209.0)

現在のソースのコピーを返します。

...equire 'json'

parser = JSON::Parser.new(DATA.read)
print parser.source

# => {
# => "Tanaka": {
# => "name":"tanaka",
# => "age":20
# => },
# => "Suzuki": {
# => "name":"suzuki",
# => "age":25
# => }
# => }

__END__
{
"Tanaka": {
"name":"tanaka",
"age":20
},
"S...
...uzuki": {
"name":"suzuki",
"age":25
}
}
//}...

Rake::Task#source -> String (21203.0)

Rake::Task#sources の最初の要素を返します。

...Rake::Task#sources の最初の要素を返します。...

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

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

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

@param name Symbol,String で定数の名前を指定します。
@param inherited true を指定するとスーパークラスや include したモジュールで定義され...
...た定数が対象にはなります。false を指定した場合 対象にはなりません。
@return ソースコードのファイル名と行番号を配列で返します。
指定した定数が見つからない場合は nil を返します。
定数は見つかったがソ...
...lass 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.rb", 12]
p B.const_source_...

Proc#source_location -> [String, Integer] | nil (12333.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 (12327.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 (12321.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
//...

Resolv::DNS#each_resource(name, typeclass) {|resource| ...} -> () (12313.0)

nameに対応するDNSリソースレコードを取得します。 見つかったリソースをひとつずつブロックに渡します。

...nameに対応するDNSリソースレコードを取得します。
見つかったリソースをひとつずつブロックに渡します。

typeclass は以下のいずれかです。
* Resolv::DNS::Resource::IN::ANY
* Resolv::DNS::Resource::IN::NS
* Resolv::DNS::Resource::IN::CNAME
*...
...Resource::IN::SOA
* Resolv::DNS::Resource::IN::HINFO
* Resolv::DNS::Resource::IN::MINFO
* Resolv::DNS::Resource::IN::MX
* Resolv::DNS::Resource::IN::TXT
* Resolv::DNS::Resource::IN::A
* Resolv::DNS::Resource::IN::WKS
* Resolv::DNS::Resource::IN::PTR
* Resolv::DNS::Resource::IN::AAAA...
...solv::DNS::Resource::IN::SRV

ルックアップ結果は Resolv::DNS::Resource (のサブクラス)のインスタンスとなります。
typeclass に Resolv::DNS::Resource::IN::ANY 以外を指定した場合には
そのクラスのインスタンスを返します。

@param name ルック...

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

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

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

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

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

Gem::SourceInfoCache#cache_file -> String (12202.0)

使用可能なキャッシュファイル名を返します。

使用可能なキャッシュファイル名を返します。

システムキャッシュが使用可能な場合はシステムキャッシュのファイル名を返します。
そうでない場合はユーザーキャッシュのファイル名を返します。
<< 1 2 3 ... > >>