392件ヒット
[301-392件を表示]
(0.173秒)
ライブラリ
- ビルトイン (62)
-
cgi
/ html (33) - csv (22)
- date (11)
- mkmf (11)
- pathname (88)
- prime (33)
-
rexml
/ document (22) - rss (44)
-
rubygems
/ old _ format (44) -
rubygems
/ require _ paths _ builder (11) - uri (11)
クラス
-
CSV
:: Row (22) - Date (11)
- Dir (6)
-
Enumerator
:: Yielder (27) -
File
:: Stat (22) -
Gem
:: OldFormat (44) - Object (7)
- Pathname (88)
-
Prime
:: TrialDivisionGenerator (33) -
REXML
:: Parent (22) -
RSS
:: Maker :: ChannelBase (22) -
RSS
:: Rss :: Channel (22) -
URI
:: LDAP (11)
モジュール
-
CGI
:: HtmlExtension (33) -
Gem
:: RequirePathsBuilder (11) - Kernel (11)
キーワード
- << (11)
- attributes (11)
- children (11)
-
delete
_ at (11) -
each
_ child (39) - fields (11)
-
file
_ entries (11) -
file
_ entries= (11) -
file
_ field (11) -
gem
_ path (11) - lastBuildDate (22)
- lastBuildDate= (22)
-
link
_ command (11) -
make
_ link (11) -
make
_ symlink (11) - next (11)
-
password
_ field (11) - realdirpath (11)
- rewind (11)
- spec (11)
- succ (11)
-
text
_ field (11) -
to
_ proc (5) -
values
_ at (11) -
world
_ readable? (22) -
world
_ writable? (22) -
write
_ require _ paths _ file _ if _ needed (11) - yield (11)
-
yield
_ self (7)
検索結果
先頭5件
-
Prime
:: TrialDivisionGenerator # succ -> Integer (9101.0) -
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。
また内部的な列挙位置を進めます。 -
Enumerator
:: Yielder # to _ proc -> Proc (9013.0) -
Enumerator.new で使うメソッドです。
...Enumerator.new で使うメソッドです。
引数を Enumerator::Yielder#yield に渡す Proc を返します。
これは Enumerator::Yielder オブジェクトを他のメソッドにブロック引数と
して直接渡すために使えます。
//emlist[例][ruby]{
text = <<-END
Hello
こ......んにちは
END
enum = Enumerator.new do |y|
text.each_line(&y)
end
enum.each do |line|
p line
end
# => "Hello\n"
# "こんにちは\n"
//}... -
Enumerator
:: Yielder # <<(object) -> () (9001.0) -
Enumerator.new で使うメソッドです。
...Enumerator.new で使うメソッドです。
生成された Enumerator オブジェクトの each メソッドを呼ぶと
Enumerator::Yielder オブジェクトが渡されたブロックが実行され、
ブロック内の << が呼ばれるたびに each に渡されたブロックが
<< に......渡された値とともに繰り返されます。
//emlist[例][ruby]{
enum = Enumerator.new do |y|
y << 1
y << 2
y << 3
end
enum.each do |v|
p v
end
# => 1
# 2
# 3
//}... -
Kernel
# link _ command(ldflags , opt = "" , libpath = $ DEFLIBPATH| $ LIBPATH) -> String (6501.0) -
実際にリンクする際に使用するコマンドを返します。
...実際にリンクする際に使用するコマンドを返します。
@param ldflags LDFLAGS に追加する値を指定します。
@param opt LIBS に追加する値を指定します。
@param libpath LIBPATH に指定する値を指定します。
@see RbConfig.expand... -
CSV
:: Row # fields(*headers _ and _ or _ indices) -> Array (6314.0) -
与えられた引数に対応する値の配列を返します。
...えられた引数に対応する値の配列を返します。
要素の探索に CSV::Row.field を使用しています。
@param headers_and_or_indices ヘッダの名前かインデックスか Range
のインスタンスか第 1 要素がヘッダの名前で......るこ
とができます。
@return 引数を与えなかった場合は全ての要素を返します。
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]... -
CSV
:: Row # values _ at(*headers _ and _ or _ indices) -> Array (6314.0) -
与えられた引数に対応する値の配列を返します。
...えられた引数に対応する値の配列を返します。
要素の探索に CSV::Row.field を使用しています。
@param headers_and_or_indices ヘッダの名前かインデックスか Range
のインスタンスか第 1 要素がヘッダの名前で......るこ
とができます。
@return 引数を与えなかった場合は全ての要素を返します。
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
row = table.first
row.values_at("a", 1, 2..3) # => ["1", "2", "3", nil]... -
Dir
# each _ child -> Enumerator (6301.0) -
ディレクトリの "." と ".." をのぞく各エントリを表す文字列を引数として、 ブロックを評価します。
...合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に self が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each_child{|f|
p f
}
#=> "bar"
# "foo"
//}
@see Dir#each
@see Dir.each_child... -
Object
# yield _ self -> Enumerator (6301.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
..."my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
re......quire 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条件......にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}
@see Object#tap......]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'......require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条......件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}
@see Object#tap... -
REXML
:: Parent # each _ child -> Enumerator (6301.0) -
各子ノードに対しブロックを呼び出します。
...各子ノードに対しブロックを呼び出します。
ブロックを省略した場合は Enumerator を返します。... -
Gem
:: OldFormat # spec -> Gem :: Specification (6201.0) -
Gem の Gem::Specification を返します。
...Gem の Gem::Specification を返します。...