るりまサーチ

最速Rubyリファレンスマニュアル検索!
289件ヒット [201-289件を表示] (0.031秒)
トップページ > クエリ:class[x] > 種類:クラス[x]

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. class new
  5. argf.class gets

ライブラリ

キーワード

検索結果

<< < 1 2 3 >>

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...
<< < 1 2 3 >>