104件ヒット
[1-100件を表示]
(0.244秒)
種類
- インスタンスメソッド (56)
- モジュール関数 (24)
- 定数 (12)
- クラス (12)
ライブラリ
- ビルトイン (104)
モジュール
-
File
:: Constants (12) - Kernel (24)
キーワード
- << (1)
- APPEND (12)
- Class (12)
-
append
_ as _ bytes (1) -
append
_ features (12) - concat (2)
- include (12)
- included (12)
- open (24)
- push (8)
検索結果
先頭5件
-
Array
# append(*obj) -> self (26101.0) -
指定された obj を順番に配列の末尾に追加します。 引数を指定しなければ何もしません。
指定された 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 (14119.0) -
モジュール(あるいはクラス)に self の機能を追加します。
...][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... -
String
# append _ as _ bytes(*objects) -> self (14119.0) -
引数で与えたオブジェクトをバイト列として、self に破壊的に連結します。
...SCII-8BIT)>
s.append_as_bytes("い") # => "\xE3\x81\x82\xE3\x81\x84"
# s << "い" では連結できない
s << "い" # => "incompatible character encodings: BINARY (ASCII-8BIT) and UTF-8 (Encoding::CompatibilityError)
//}
//emlist[引数で整数を渡す例][ruby]{
t = ""
t.append_as_bytes(0x6......1) # => "a"
t.append_as_bytes(0x3062) # => "ab"
//}
@see String#<<, String#concat... -
File
:: Constants :: APPEND -> Integer (14101.0) -
追記モードでファイルを開くときに指定します。 File.openで使用します。
追記モードでファイルを開くときに指定します。
File.openで使用します。 -
Array
# push(*obj) -> self (11001.0) -
指定された obj を順番に配列の末尾に追加します。 引数を指定しなければ何もしません。
指定された 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#<< -
Class (8006.0)
-
クラスのクラスです。
...すが、それ以外のほとんどの機能は Module から継
承されています。Module のメソッドのうち
* Module#module_function
* Module#extend_object
* Module#append_features
* Module#prepend_features
* Module#refine
は Class では未定義にされています。... -
Kernel
. # open(file , mode _ enc = "r" , perm = 0666) -> IO (8006.0) -
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
...プンします。
オープン時にファイルがすでに存在していれば
その内容を空にします。
: "a", WRONLY|CREAT|APPEND
ファイルを書き込みモードでオープンします。
出力は 常に ファイルの末尾に追加されます。
例え... -
Kernel
. # open(file , mode _ enc = "r" , perm = 0666) {|io| . . . } -> object (8006.0) -
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
...プンします。
オープン時にファイルがすでに存在していれば
その内容を空にします。
: "a", WRONLY|CREAT|APPEND
ファイルを書き込みモードでオープンします。
出力は 常に ファイルの末尾に追加されます。
例え... -
Module
# include(*mod) -> self (8006.0) -
モジュール mod をインクルードします。
...場合に発生します。
//emlist[例][ruby]{
module M
end
module M2
include M
end
module M
include M2
end
//}
実行結果:
-:3:in `append_features': cyclic include detected (ArgumentError)
from -:3:in `include'
from -:3
インクルードとは、指定された... -
Module
# included(class _ or _ module) -> () (8006.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...
