るりまサーチ

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

別のキーワード

  1. _builtin |
  2. set |
  3. ipaddr |
  4. array |
  5. integer |

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Bignum#&(other) -> Fixnum | Bignum (18214.0)

ビット二項演算子。論理積を計算します。

...ビット二項演算子。論理積を計算します。

@param other 数値

1 & 1 #=> 1
2 & 3 #=> 2...

Fixnum#&(other) -> Fixnum | Bignum (18214.0)

ビット二項演算子。論理積を計算します。

...ビット二項演算子。論理積を計算します。

@param other 数値

1 & 1 #=> 1
2 & 3 #=> 2...

Net::HTTP#post(path, data, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (138.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...ost('/cgi-bin/search.rb', 'query=subject&target=ruby')

# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-bin/search.rb', 'query=subject&target=ruby') do |str|
f.write str
end
}
//}

@see Net:...

Pathname#each_line(*args) {|line| ... } -> nil (136.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...IO.foreach(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("tes...
...ne2,\nline3\n")
Pathname("testfile").each_line {|f| p f }

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# =>...
..."2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Pathname("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

TSort#each_strongly_connected_component_from(node, id_map={}, stack=[]) {|nodes| ...} -> () (126.0)

node から到達可能な強連結成分についてのイテレータです。

...y
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", no...

絞り込み条件を変える

Shell#out(dev = STDOUT, &block) -> () (120.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Shell::CommandProcessor#out(dev = STDOUT, &block) -> () (120.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Shell::Filter#out(dev = STDOUT, &block) -> () (120.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

TSort#tsort_each {|node| ...} -> nil (120.0)

TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}

non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|
printf("%d -> %d\n", node, child)
}
}

# 出力
#=> 2 -> 3
#=...

OpenURI::OpenRead#open(mode = &#39;r&#39;, perm = nil, options = {}) {|sio| ... } -> nil (118.0)

自身が表すリソースを取得して StringIO オブジェクトとして返します。 OpenURI.open_uri(self, *rest, &block) と同じです。

...自身が表すリソースを取得して StringIO オブジェクトとして返します。
OpenURI.open_uri(self, *rest, &block) と同じです。

ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に Strin...

絞り込み条件を変える

Pathname#open(mode = &#39;r&#39;, perm = 0666) {|file| ... } -> object (118.0)

File.open(self.to_s, *args, &block) と同じです。

...File.open(self.to_s, *args, &block) と同じです。


@see File.open...

Pathname#opendir {|dir| ... } -> nil (118.0)

Dir.open(self.to_s, &block) と同じです。

...Dir.open(self.to_s, &block) と同じです。


@see Dir.open...
<< 1 2 3 ... > >>