るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

Rake::InvocationChain#append(task_name) -> Rake::InvocationChain (24320.0)

与えられたタスク名を追加して新しい Rake::InvocationChain を返します。

...ク名を追加して新しい Rake::InvocationChain を返します。

@param task_name 追加するタスク名を指定します。

@raise RuntimeError 循環したタスクの呼び出しを検出した場合に発生します。

//emlist[][ruby]{
# Rakefile での記載例とする

task def...
...ault: :test_rake_app
task :test_rake_app do
i
nvocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
i
nvocation_chain.append("task_b") # => LL("task_b", "task_a")
end
//}...

String#append_as_bytes(*objects) -> self (9144.0)

引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。

.../emlist[例][ruby]{
s = "あ".b # => "\xE3\x81\x82"
s.encoding # => #<Encoding:BINARY (ASCII-8BIT)>
s.append_as_bytes("い") # => "\xE3\x81\x82\xE3\x81\x84"

# s << "い" では連結できない
s << "い" # => "incompatible character encodings: BINARY (ASCII-8BIT) a...
...nd UTF-8 (Encoding::CompatibilityError)
//}

//emlist[引数で整数を渡す例][ruby]{
t = ""
t.append_as_bytes(0x61) # => "a"
t.append_as_bytes(0x3062) # => "ab"
//}

@see String#<<, String#concat...

Module#include(*mod) -> self (6143.0)

モジュール mod をインクルードします。

...指定します。

@raise ArgumentError 継承関係が循環してしまうような include を行った場合に発生します。

//emlist[例][ruby]{
module M
end
module M2
i
nclude M
end
module M
i
nclude M2
end
//}

実行結果:

-:3:in `append_features': cyclic include detected (Argum...
...in `include'
from -:3


インクルードとは、指定されたモジュールの定義
(メソッド、定数) を引き継ぐことです。
インクルードは多重継承の代わりに用いられており、 mix-in とも呼びます。

//emlist[例][ruby]{
class C
i
nclude Fi...
...leTest
i
nclude Math
end

p C.ancestors

# => [C, Math, FileTest, Object, Kernel]
//}

モジュールの機能追加は、クラスの継承関係の間にそのモジュールが挿入
されることで実現されています。従って、メソッドの探索などは
スーパークラスよ...

Module#included(class_or_module) -> () (6119.0)

self が Module#include されたときに対象のクラスまたはモジュー ルを引数にしてインタプリタがこのメソッドを呼び出します。

...e#include されたときに対象のクラスまたはモジュー
ルを引数にしてインタプリタがこのメソッドを呼び出します。

@param class_or_module Module#include を実行したオブジェクト

//emlist[例][ruby]{
module Foo
def self.included(mod)
p "#{mod} in...
...clude #{self}"
end
end
class Bar
i
nclude Foo
end
# => "Bar include Foo"
//}

@see Module#append_features...

String#concat(*arguments) -> self (3021.0)

self に複数の文字列を破壊的に連結します。

...数である場合は Integer#chr の結果に相当する文字を末尾に追加します。追加する文字のエンコーディングは self.encoding です。

self を返します。

@param arguments 複数の文字列もしくは 0 以上の整数

//emlist[例][ruby]{
str = "foo"
str.con...
...cat
p str # => "foo"

str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"

str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}

@see String#append_as_bytes...

絞り込み条件を変える

String#<<(other) -> self (3016.0)

self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。

...lf.encoding) 相当の文字を末尾に追加します。

self を返します。

@param other 文字列もしくは 0 以上の整数

//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"

str << "YYY"
p str # => "stringXXXYYY"

str << 65 # 文字AのASCIIコー...
...
p str # => "stringXXXYYYA"
//}...

String#concat(other) -> self (3016.0)

self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。

...lf.encoding) 相当の文字を末尾に追加します。

self を返します。

@param other 文字列もしくは 0 以上の整数

//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"

str << "YYY"
p str # => "stringXXXYYY"

str << 65 # 文字AのASCIIコー...
...
p str # => "stringXXXYYYA"
//}...