80件ヒット
[1-80件を表示]
(0.031秒)
別のキーワード
ライブラリ
- ビルトイン (47)
-
irb
/ context (11) -
irb
/ workspace (11)
キーワード
- Binding (11)
- Context (11)
- NoMethodError (11)
- Numeric (11)
- Options (11)
- Refinement (3)
- UnboundMethod (11)
- WorkSpace (11)
検索結果
-
Numeric (55.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...ます。
//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 rounddown(d=0)
x = 10**d
if self < 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end......def roundoff(d=0)
x = 10**d
if self < 0
(self.quo(x) - 0.5).ceil * x
else
(self.quo(x) + 0.5).floor * x
end
end
end
//}... -
Binding (17.0)
-
ローカル変数のテーブルと self、モジュールのネストなどの情報を保 持するオブジェクトのクラスです。
...ローカル変数のテーブルと self、モジュールのネストなどの情報を保
持するオブジェクトのクラスです。
組み込み関数 Kernel.#binding と Proc#binding によっ
てのみ生成され、Kernel.#eval の第 2 引数に使用します。
またトップレベ... -
IRB
:: WorkSpace (17.0) -
irb 中で self を表すためのクラスです。
...irb 中で self を表すためのクラスです。... -
Refinement (17.0)
-
refine のブロックの中の self のクラスです。
...refine のブロックの中の self のクラスです。
Refinement#import_methodsで他のモジュールからメソッドを
インポートできます。... -
RDoc
:: Options (13.0) -
rdoc コマンドのオプションを解析するためのクラスです。
...ます。rdoc --help を実行すると追加したオプションの一覧が
確認できます。
例:
class RDoc::Generator::Spellcheck
RDoc::RDoc.add_generator self
def self.setup_options rdoc_options
op = rdoc_options.option_parser
op.on('--spell-dictionary DICTIONARY... -
IRB
:: Context (7.0) -
irb の設定を扱うためのクラスです。
...て irb を実行した場合のパスを文字列で返します。
デフォルト値は nil です。
: IRB.conf[:SINGLE_IRB]
irb 中で self を実行して得られるオブジェクトをサブ irb と共有するかど
うかを設定します。true を設定した場合に共有さ... -
NoMethodError (7.0)
-
定義されていないメソッドの呼び出しが行われたときに発生します。
...定義されていないメソッドの呼び出しが行われたときに発生します。
例:
self.bar
# => -:1: undefined method `bar' for #<Object:0x401a6c40> (NoMethodError)
プライベートなインスタンスメソッドを呼び出そうとした場合にも発生します。... -
UnboundMethod (7.0)
-
レシーバを持たないメソッドを表すクラスです。 呼び出すためにはレシーバにバインドする必要があります。
...とができます。
//emlist[例: Method クラスの冒頭にある例を UnboundMethod で書くと以下のようになります。][ruby]{
class Foo
def foo() "foo" end
def bar() "bar" end
def baz() "baz" end
end
# 任意のキーとメソッドの関係をハッシュに保持して......ソッドの再定義を UnboundMethod を使って行う方法です。普通は alias や super を使います。][ruby]{
class Foo
def foo
p :foo
end
@@orig_foo = instance_method :foo
def foo
p :bar
@@orig_foo.bind(self).call
end
end
Foo.new.foo
# => :bar
# :foo
//}...