289件ヒット
[201-289件を表示]
(0.031秒)
ライブラリ
- ビルトイン (130)
- digest (12)
- etc (12)
- fiddle (12)
- logger (1)
- psych (24)
-
rdoc
/ anon _ class (12) -
rdoc
/ class _ module (12) -
rdoc
/ markup (12) -
rdoc
/ normal _ class (12) -
rdoc
/ single _ class (12) -
ripper
/ filter (12) - thread (2)
- timeout (12)
キーワード
-
ARGF
. class (12) - AnonClass (12)
- Application (1)
- BasicObject (12)
- Class (24)
- ClassModule (12)
- Closure (12)
- ConditionVariable (12)
- Error (12)
- FalseClass (12)
- Filter (12)
- Location (12)
- Markup (12)
- Method (12)
- NilClass (12)
- NormalClass (12)
- Numeric (12)
- Options (12)
- Parser (12)
- Passwd (12)
- SingleClass (12)
- TrueClass (12)
- UnboundMethod (12)
- Visitors (12)
検索結果
-
BasicObject (7.0)
-
特殊な用途のために意図的にほとんど何も定義されていないクラスです。 Objectクラスの親にあたります。Ruby 1.9 以降で導入されました。
...クラスから派生すべきです。
真に必要な場合にだけ BasicObject から派生してください。
=== 例
//emlist[例][ruby]{
class Proxy < BasicObject
def initialize(target)
@target = target
end
def method_missing(message, *args)
@target.__send__(message, *args... -
Etc
:: Passwd (7.0) -
Etc.#getpwent で得られる構造体。
...ステムには反映されません。
全てのシステムで提供されているメンバ。
* name
* passwd
* uid
* gid
* gecos
* dir
* shell
以降のメンバはシステムによっては提供されません。
* change
* quota
* age
* class
* comment
* expire... -
Logger
:: Application (7.0) -
ユーザ定義のアプリケーションにログ機能を簡単に追加することができます。
...行う run メソッドを定義します。
(3) そのクラスをインスタンス化して start メソッドを呼び出します。
例:
class FooApp < Application
def initialize(foo_app, application_specific, arguments)
super('FooApp') # Name of the application.
end... -
Numeric (7.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...d
//}
また、任意桁の切上げ、切捨て、四捨五入を行うメソッドは以下のように
定義できます。
//emlist[][ruby]{
class Numeric
def roundup(d=0)
x = 10**d
if self > 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end
def roun... -
Psych
:: Parser (7.0) -
YAML のパーサ。
...。
以下の例では YAML ドキュメント に含まれているスカラー値を表示します。
# Handler for detecting scalar values
class ScalarHandler < Psych::Handler
def scalar value, anchor, tag, plain, quoted, style
puts value
end
end
parser = Psych::Parser.n... -
RDoc
:: Markup (7.0) -
RDoc 形式のドキュメントを目的の形式に変換するためのクラスです。
...フォーマットを行うようにパーサを拡張する事もできます。
例:
require 'rdoc/markup'
require 'rdoc/markup/to_html'
class WikiHtml < RDoc::Markup::ToHtml
# WikiWord のフォントを赤く表示。
def handle_special_WIKIWORD(special)
"<font color=red>... -
RDoc
:: Options (7.0) -
rdoc コマンドのオプションを解析するためのクラスです。
...ンは必ず指定
する必要があります。rdoc --help を実行すると追加したオプションの一覧が
確認できます。
例:
class RDoc::Generator::Spellcheck
RDoc::RDoc.add_generator self
def self.setup_options rdoc_options
op = rdoc_options.option_parser... -
Thread
:: Backtrace :: Location (7.0) -
Ruby のフレームを表すクラスです。
...例1の実行結果:
caller_locations.rb:2:in `a'
caller_locations.rb:5:in `b'
caller_locations.rb:8:in `c'
//emlist[例2][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
p... -
Thread
:: ConditionVariable (7.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...が空になった場合、
あるいは満タンになった場合に Condition Variable を使って wait しています。
require 'thread'
class TinyQueue
def initialize(max=2)
@max = max
@full = ConditionVariable.new
@empty = ConditionVariable.new
@mutex = Mut...