るりまサーチ

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

別のキーワード

  1. irb/input-method gets
  2. irb/input-method new
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

ライブラリ

検索結果

<< < ... 11 12 13 >>

Module#public() -> nil (13.0)

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

...mlist[例][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 # => 2
p self.bar...

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

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

...mlist[例][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 # => 2
p self.bar...

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

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

...mlist[例][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 # => 2
p self.bar...

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

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

...mlist[例][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 # => 2
p self.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 を返します。

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

省略可能な第二引数 pos を指定すると...
...captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}

pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}

//emlist[][ruby]{
re.match(str, pos)
//}
は異なります。...
...チした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。

//emlist[例][ruby]{
results = []
/((.)\2)/.match("foo") {|m| results << m[0]...
<< < ... 11 12 13 >>