52件ヒット
[1-52件を表示]
(0.151秒)
別のキーワード
クラス
- Array (16)
- Module (24)
-
Rake
:: InvocationChain (12)
キーワード
-
append
_ features (12) - included (12)
- push (8)
検索結果
先頭5件
-
Rake
:: InvocationChain # append(task _ name) -> Rake :: InvocationChain (21214.0) -
与えられたタスク名を追加して新しい Rake::InvocationChain を返します。
...新しい Rake::InvocationChain を返します。
@param task_name 追加するタスク名を指定します。
@raise RuntimeError 循環したタスクの呼び出しを検出した場合に発生します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app......task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.append("task_b") # => LL("task_b", "task_a")
end
//}... -
Array
# append(*obj) -> self (21108.0) -
指定された obj を順番に配列の末尾に追加します。 引数を指定しなければ何もしません。
...れば何もしません。
@param obj 自身に追加したいオブジェクトを指定します。
//emlist[例][ruby]{
array = [1, 2, 3]
array.push 4
array.push [5, 6]
array.push 7, 8
p array # => [1, 2, 3, 4, [5, 6], 7, 8]
//}
@see Array#pop, Array#shift, Array#unshift, Array#<<... -
Module
# append _ features(module _ or _ class) -> self (12232.0) -
モジュール(あるいはクラス)に self の機能を追加します。
... Ruby で書くと以下のように定義できます。
//emlist[例][ruby]{
def include(*modules)
modules.reverse_each do |mod|
# append_features や included はプライベートメソッドなので
# 直接 mod.append_features(self) などとは書けない
mod.__send__(:append......_features, self)
mod.__send__(:included, self)
end
end
//}
@see Module#included... -
Array
# push(*obj) -> self (6008.0) -
指定された obj を順番に配列の末尾に追加します。 引数を指定しなければ何もしません。
...れば何もしません。
@param obj 自身に追加したいオブジェクトを指定します。
//emlist[例][ruby]{
array = [1, 2, 3]
array.push 4
array.push [5, 6]
array.push 7, 8
p array # => [1, 2, 3, 4, [5, 6], 7, 8]
//}
@see Array#pop, Array#shift, Array#unshift, Array#<<... -
Module
# included(class _ or _ module) -> () (113.0) -
self が Module#include されたときに対象のクラスまたはモジュー ルを引数にしてインタプリタがこのメソッドを呼び出します。
...このメソッドを呼び出します。
@param class_or_module Module#include を実行したオブジェクト
//emlist[例][ruby]{
module Foo
def self.included(mod)
p "#{mod} include #{self}"
end
end
class Bar
include Foo
end
# => "Bar include Foo"
//}
@see Module#append_features...