別のキーワード
ライブラリ
- ビルトイン (2)
-
fiddle
/ import (1) - forwardable (2)
-
irb
/ ext / save-history (1) -
irb
/ extend-command (2) - json (2)
- monitor (1)
-
mutex
_ m (1) - open-uri (1)
- optparse (1)
- profiler (1)
キーワード
- Arguable (1)
- ContextExtender (1)
- ExtendCommandBundle (1)
- Forwardable (1)
- HistorySavingAbility (1)
- Importer (1)
- Meta (1)
- MonitorMixin (1)
-
Mutex
_ m (1) -
Profiler
_ _ (1) - SingleForwardable (1)
- WaitReadable (1)
- WaitWritable (1)
検索結果
先頭5件
-
JSON
:: Ext :: Generator :: GeneratorMethods :: String :: Extend (54052.0) -
Alias of JSON::Generator::GeneratorMethods::String::Extend
Alias of JSON::Generator::GeneratorMethods::String::Extend -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (54004.0) -
String に JSON で使用する特異メソッドを追加するためのモジュールです。
String に JSON で使用する特異メソッドを追加するためのモジュールです。 -
IRB
:: ContextExtender (18004.0) -
IRB::Context を拡張するためのモジュールです。
IRB::Context を拡張するためのモジュールです。 -
IRB
:: ExtendCommandBundle (18004.0) -
irb のコマンドを拡張するためのモジュールです。
irb のコマンドを拡張するためのモジュールです。 -
MonitorMixin (94.0)
-
スレッドの同期機構としてのモニター機能を提供するモジュールです。
...スレッドの同期機構としてのモニター機能を提供するモジュールです。
クラスに Module#include したり、オブジェクトに
Object#extend したりすることでそのクラス/オブジェクトに
モニタ機能を追加します。
=== 例
//emlist[消費......//emlist[extend する例][ruby]{
require 'monitor'
buf = []
buf.extend(MonitorMixin)
//}
しかし、MonitorMixin をクラス定義の際に Module#include を使って
利用する場合は、initialize メソッドで super() か super を呼んで、初期化する必要があります。... -
Mutex
_ m (88.0) -
スレッド同期機構である Thread::Mutex のモジュール版です。クラスに Module#include することでそのクラスに Mutex 機能を持たせることができます。 また、普通のオブジェクトを Object#extend により Mutex にする事ができます。
...スレッド同期機構である Thread::Mutex のモジュール版です。クラスに
Module#include することでそのクラスに Mutex 機能を持たせることができます。
また、普通のオブジェクトを Object#extend により Mutex にする事ができます。
この......tex_m#locked?, Mutex_m#try_lock, Mutex_m#unlock)
はモジュールにincludeした場合には定義されません。
1991
=== 例
クラスに Module#include する例
require "mutex_m"
class Foo
include Mutex_m
...
end
obj = Foo.new
obj.synchronize do
# 危険領域(crit... -
SingleForwardable (58.0)
-
オブジェクトに対し、メソッドの委譲機能を定義するモジュールです。
...ようにする事もできます。
require 'forwardable'
class Implementation
def self.service
puts "serviced!"
end
end
module Facade
extend SingleForwardable
def_delegator :Implementation, :service
end
Facade.service # => serviced!
もし Forwardable と Si... -
IRB
:: HistorySavingAbility (52.0) -
IRB::HistorySavingAbility を extend したオブジェクトに irb のヒス トリの読み込み、保存の機能を提供するモジュールです。
IRB::HistorySavingAbility を extend したオブジェクトに irb のヒス
トリの読み込み、保存の機能を提供するモジュールです。 -
OpenURI
:: Meta (52.0) -
サーバから取得したデータの属性を扱うために使われるモジュールです。 データを表す文字列や StringIO が extend します。
サーバから取得したデータの属性を扱うために使われるモジュールです。
データを表す文字列や StringIO が extend します。 -
OptionParser
:: Arguable (52.0) -
主に Object::ARGV を拡張するために用意されたモジュールです。 optparse を require することにより、ARGV は OptionParser::Arguable を Object#extend します。
主に Object::ARGV を拡張するために用意されたモジュールです。
optparse を require することにより、ARGV は
OptionParser::Arguable を Object#extend します。
コマンドライン引数を表す文字列の配列を、拡張するためにも使うことができます。 -
Forwardable (40.0)
-
クラスに対し、メソッドの委譲機能を定義するモジュールです。
...し、メソッドの委譲機能を定義するモジュールです。
=== 使い方
クラスに対して Object#extend して使います。Module#include でないところに注意して下さい。
例:
require 'forwardable'
class Foo
extend Forwardable
def_delegators("@o... -
Profiler
_ _ (40.0) -
プロファイラの実装です。 Profiler__.start_profile 実行から、Profiler__.stop_profile までの 区間の実行コードのプロファイルを取得します。
...0.19 514 0.37 0.37 Module#method_added
6.57 1.80 0.14 1 140.00 140.00 Profiler__.start_profile
4.23 1.89 0.09 15 6.00 10.67 Kernel.extend
3.29 1.96 0.07 15 4.67 4.67 Module#extend_object
3.29 2.......0.06 28 2.14 2.86 Module#attr
1.88 2.13 0.04 19 2.11 2.11 Module#private
1.41 2.16 0.03 29 1.03 1.38 Module#include
0.94 2.18 0.02 10 2.00 4.00 Module#module_function
0.94 2.20 0.... -
Fiddle
:: Importer (22.0) -
C の関数をモジュールにインポートするためのモジュールです。
C の関数をモジュールにインポートするためのモジュールです。
対象となるモジュールに Object#extend することで、
そのモジュールにインポートできるようになります。
使いかたは fiddle や fiddle/import を参照してください。 -
IO
:: WaitReadable (22.0) -
例外が読み込み待ちで発生したことを意味します。
例外が読み込み待ちで発生したことを意味します。
例外オブジェクトに extend されます。詳しくは
IO#read_nonblock を参照してください。 -
IO
:: WaitWritable (22.0) -
例外が書き込み待ちで発生したことを意味します。
例外が書き込み待ちで発生したことを意味します。
例外オブジェクトに extend されます。詳しくは
IO#write_nonblock を参照してください。