るりまサーチ

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

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. service drb::extserv#stop_service

ライブラリ

検索結果

<< < ... 11 12 13 >>

Module#public() -> nil (13.0)

メソッドを public に設定します。

...発生します。

//emlist[例][ruby]{
def foo() 1 end
p foo # => 1
# the toplevel default is private
p self.foo # => private method `foo' called for #<Object:0x401c83b0> (NoMethodError)

def bar() 2 end
public :bar # visibility changed (all access allowed)
p bar...

Module#public(*name) -> Array (13.0)

メソッドを public に設定します。

...発生します。

//emlist[例][ruby]{
def foo() 1 end
p foo # => 1
# the toplevel default is private
p self.foo # => private method `foo' called for #<Object:0x401c83b0> (NoMethodError)

def bar() 2 end
public :bar # visibility changed (all access allowed)
p bar...

Module#public(name) -> String | Symbol (13.0)

メソッドを public に設定します。

...発生します。

//emlist[例][ruby]{
def foo() 1 end
p foo # => 1
# the toplevel default is private
p self.foo # => private method `foo' called for #<Object:0x401c83b0> (NoMethodError)

def bar() 2 end
public :bar # visibility changed (all access allowed)
p bar...

Module#public(names) -> Array (13.0)

メソッドを public に設定します。

...発生します。

//emlist[例][ruby]{
def foo() 1 end
p foo # => 1
# the toplevel default is private
p self.foo # => private method `foo' called for #<Object:0x401c83b0> (NoMethodError)

def bar() 2 end
public :bar # visibility changed (all access allowed)
p bar...

Module#yaml_as(tag) -> () (13.0)

クラスと tag の間を関連付けます。

...された YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。

この method は deprecated です。 Object.yaml_tag を
かわりに使ってください。

@param tag 対象のクラスに関連付けるタグの文字列...

絞り込み条件を変える

NameError#name -> Symbol (13.0)

この例外オブジェクトを発生させる原因となった 変数や定数、メソッドの名前をシンボルで返します。

...クトを発生させる原因となった
変数や定数、メソッドの名前をシンボルで返します。

例:

begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.name # => :foobar
end...

Regexp#match(str, pos = 0) -> MatchData | nil (8.0)

指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。

...s では、マッチに失敗した場合、
nil.captures を呼び出そうとして例外 NoMethodError が発生して
しまいます。

//emlist[例][ruby]{
foo, bar, baz = /(foo)(bar)(baz)/.match("foobar").captures

# => -:1: undefined method `captures' for nil:NilClass (NoMethodError)
//}...
...に失敗した場合、
nil.captures を呼び出そうとして例外 NoMethodError が発生して
しまいます。

//emlist[例][ruby]{
foo, bar, baz = /(foo)(bar)(baz)/.match("foobar").captures

# => -:1: undefined method `captures' for nil:NilClass (NoMethodError)
//}

@see Regexp#match?...
<< < ... 11 12 13 >>