るりまサーチ

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

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. net/imap name
  4. openssl name
  5. win32ole name

ライブラリ

クラス

検索結果

<< 1 2 > >>

Rake::FileList#include(*filenames) -> self (18214.0)

ファイル名のパターンを追加リストに登録します。 配列が与えられた場合、配列の各要素が追加されます。

...ターンを追加リストに登録します。
配列が与えられた場合、配列の各要素が追加されます。

@param filenames 追加するファイル名のパターンを指定します。

例:
file_list.include("*.java", "*.cfg")
file_list.include %w( math.c lib.h *.o )...

Pathname#each_child(with_directory = true) {|pathname| ...} -> [Pathname] (3213.0)

self.children(with_directory).each と同じです。

...hname"

Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:...
.../usr/local/var>

Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}

@see Pathname#children...

CSV::Row#include?(name) -> bool (3210.0)

自身のヘッダに与えられた値が含まれている場合は真を返します。 そうでない場合は偽を返します。

...自身のヘッダに与えられた値が含まれている場合は真を返します。
そうでない場合は偽を返します。

@param name この行のヘッダに含まれているかどうか調べたい値を指定します。

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

row = CSV::Row.new(["h...

Pathname#each_entry {|pathname| ... } -> nil (3107.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...s) {|f| yield Pathname.new(f) } と同じです。


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

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@see Di...
...Pathname.new(f) } と同じです。

ブロックを省略した場合は Enumerator を返します。

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

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
#...
...=> #<Pathname:lib>
# => #<Pathname:opt>
//}

@see Dir.foreach...

Pathname#entries -> [Pathname] (3107.0)

self に含まれるファイルエントリ名を元にした Pathname オブジェクトの配列を返します。

...た Pathname オブジェクトの配列を返します。

@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。

//emlist[例][ruby]{
require 'pathname'
require 'pp'

pp Pathname('/usr/local').entries
# => [#<Pathname:.>,
#...
...#<Pathname:..>,
# #<Pathname:bin>,
# #<Pathname:etc>,
# #<Pathname:include>,
# #<Pathname:lib>,
# #<Pathname:opt>,
# #<Pathname:sbin>,
# #<Pathname:share>,
# #<Pathname:var>]
//}

@see Dir.entries...

絞り込み条件を変える

Pathname#each_child(with_directory = true) -> Enumerator (3013.0)

self.children(with_directory).each と同じです。

...hname"

Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/usr/local/lib>
# => #<Pathname:/usr/local/opt>
# => #<Pathname:/usr/local/sbin>
# => #<Pathname:/usr/local/share>
# => #<Pathname:...
.../usr/local/var>

Pathname("/usr/local").each_child(false) {|f| p f }
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
# => #<Pathname:sbin>
# => #<Pathname:share>
# => #<Pathname:var>
//}

@see Pathname#children...

Pathname#each_entry -> Enumerator (3007.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...Pathname.new(f) } と同じです。

ブロックを省略した場合は Enumerator を返します。

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

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
#...
...=> #<Pathname:lib>
# => #<Pathname:opt>
//}

@see Dir.foreach...

Object#respond_to?(name, include_all = false) -> bool (255.0)

オブジェクトがメソッド name を持つとき真を返します。

...オブジェクトがメソッド name を持つとき真を返します。

オブジェクトが メソッド name を持つというのは、
オブジェクトが メソッド name に応答できることをいいます。

Windows での Process.fork や GNU/Linux での File.lchmod の
...
...いない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。

@param name Symbol または文字列で指定するメソッド名です。

@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを t...
...mentedError.new
end

def finish
puts "finish"
end
end

class ImplTemplateMethod
include
Template
def template_method
"implement template_method"
end
end

class NotImplTemplateMethod
include
Template

# not implement template_method
end

puts ImplTemplateMethod.new.respond_to?...

Module#const_get(name, inherit = true) -> object (160.0)

name で指定される名前の定数の値を取り出します。

...
name
で指定される名前の定数の値を取り出します。

Module#const_defined? と違って Object を特別扱いすることはありません。

@param name 定数名。String か Symbol で指定します。
完全修飾名を指定しなかった場合はモジュー...
...定義されている
name
で指定される名前の定数の値を取り出します。

@param inherit false を指定するとスーパークラスや include したモジュールで
定義された定数は対象にはなりません。

@raise NameError 定数が定義さ...
...ます。

//emlist[例][ruby]{
module Bar
BAR = 1
end
class Object
include
Bar
end
# Object では include されたモジュールに定義された定数を見付ける
p Object.const_get(:BAR) # => 1

class Baz
include
Bar
end
# Object以外でも同様
p Baz.const_get(:BAR) # => 1...

Module#const_defined?(name, inherit = true) -> bool (154.0)

モジュールに name で指定される名前の定数が定義されている時真 を返します。

...ュールに name で指定される名前の定数が定義されている時真
を返します。

スーパークラスや include したモジュールで定義された定数を検索対象
にするかどうかは第二引数で制御することができます。

@param name String, Symbol...
...@param inherit false を指定するとスーパークラスや include したモジュールで
定義された定数は対象にはなりません。


//emlist[例][ruby]{
module Kernel
FOO = 1
end

# Object は include したモジュールの定数に対しても
# true を返す
p O...
...bject.const_defined?(:FOO) # => true

module Bar
BAR = 1
end
class Object
include
Bar
end
# ユーザ定義のモジュールに対しても同様
p Object.const_defined?(:BAR) # => true

class Baz
include
Bar
end
# Object 以外でも同様になった
# 第二引数のデフォルト値...

絞り込み条件を変える

<< 1 2 > >>