6件ヒット
[1-6件を表示]
(0.233秒)
クラス
キーワード
-
each
_ child (2) - tag (1)
検索結果
先頭5件
-
RubyVM
:: AbstractSyntaxTree :: Node # children -> Array (81925.0) -
self の子ノードを配列で返します。
self の子ノードを配列で返します。
どのような子ノードが返ってくるかは、そのノードの type によって異なります。
戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//} -
Psych
:: Nodes :: Node # children -> [Psych :: Nodes :: Node] (81907.0) -
子ノードの集合を配列で返します。
子ノードの集合を配列で返します。 -
Pathname
# children(with _ directory = true) -> [Pathname] (72925.0) -
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
self 配下にあるパス名(Pathnameオブジェクト)の配列を返します。
ただし、 ".", ".." は要素に含まれません。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new("/tmp").children # => [#<Pathname:.X11-unix>, #<Pathname:.iroha_unix>... -
Pathname
# each _ child(with _ directory = true) -> Enumerator (18670.0) -
self.children(with_directory).each と同じです。
self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Pathname
# each _ child(with _ directory = true) {|pathname| . . . } -> [Pathname] (18670.0) -
self.children(with_directory).each と同じです。
self.children(with_directory).each と同じです。
@param with_directory 偽を指定するとファイル名のみ返します。デフォルトは真です。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_child {|f| p f }
# => #<Pathname:/usr/local/bin>
# => #<Pathname:/usr/local/etc>
# => #<Pathname:/usr/local/include>
# => #<Pathname:/us... -
Psych
:: Nodes :: Node # tag -> String | nil (9376.0) -
ノードに付加されたタグを返します。
ノードに付加されたタグを返します。
タグが付加されていない場合は nil を返します。
ast = Psych.parse(<<EOS)
---
- !!str a
- b
EOS
p ast.root.children[0].value # => "a"
p ast.root.children[0].tag # => "tag:yaml.org,2002:str"
p ast.root.children[1].value # => "b"
p ast.root.children[1].tag # => nil