るりまサーチ

最速Rubyリファレンスマニュアル検索!
120件ヒット [101-120件を表示] (0.091秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

検索結果

<< < 1 2 >>

Module#private_constant(*name) -> self (145.0)

name で指定した定数の可視性を private に変更します。

...変更します。

@
param name 0 個以上の String か Symbol を指定します。

@
raise NameError 存在しない定数を指定した場合に発生します。

@
return self を返します。

@
see Module#public_constant, Object#untrusted?

//emlist[例][ruby]{
module
Foo
BAR = 'bar'
c...
...private に変更します。

@
param name 0 個以上の String か Symbol を指定します。

@
raise NameError 存在しない定数を指定した場合に発生します。

@
return self を返します。

@
see Module#public_constant

//emlist[例][ruby]{
module
Foo
BAR = 'bar'
class Ba...

Module#instance_method(name) -> UnboundMethod (60.0)

self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

...
self
のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

@
param name メソッド名を Symbol または String で指定します。

@
raise NameError self に存在しないメソッドを指定した場合に発生します。

@
see Module#publ...
...ic_instance_method, Object#method

//emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; end
def do_d() print "Hello "; end
def do_e() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),...
..."e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end

interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!
//}...
<< < 1 2 >>