るりまサーチ

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

別のキーワード

  1. format spec
  2. format spec=
  3. installer spec
  4. oldformat spec
  5. uninstaller spec

クラス

キーワード

検索結果

Method#===(*args) -> object (9.0)

メソッドオブジェクトに封入されているメソッドを起動します。

...Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1...
...[] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m...

Method#[](*args) -> object (9.0)

メソッドオブジェクトに封入されているメソッドを起動します。

...Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1...
...[] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m...

Method#call(*args) -> object (9.0)

メソッドオブジェクトに封入されているメソッドを起動します。

...Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1...
...[] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m...

Method#call(*args) { ... } -> object (9.0)

メソッドオブジェクトに封入されているメソッドを起動します。

...Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1...
...[] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m...

Object#taint -> self (9.0)

このメソッドは Ruby 2.7 から deprecated で、Ruby 3.2 で削除予定です。

...得られる文字列)など一部のオブジェクトは最初から汚染されています。
オブジェクトの汚染に関してはspec/safelevelを参照してください。

//emlist[][ruby]{
$SAFE = 1

some = "puts '@&%&(#!'"
p some.tainted? #=> false
eval(some) #=> @&%&(#!

some.tain...

絞り込み条件を変える

Object#tainted? -> bool (9.0)

...オブジェクトの「汚染マーク」がセットされている時真を返します。

オブジェクトの汚染に関してはspec/safelevelを参照してください。

//emlist[][ruby]{
p String.new.tainted? #=> false
p ENV['OS'].tainted? #=> true
//}

このメソッドは Ruby 2.7...

Object#untaint -> self (9.0)

オブジェクトの「汚染マーク」を取り除きます。

...取り除くことによる危険性はプログラマが責任を負う必要が
あります。

オブジェクトの汚染に関してはspec/safelevelを参照してください。


ruby -e 'p ARGV[0].tainted?;t=+ARGV[0];t.untaint;p t.tainted?' hoge
# => true
# false

このメソッド...

Thread#safe_level -> Integer (9.0)

self のセーフレベルを返します。カレントスレッドの safe_level は、$SAFE と同じです。

...$SAFEがプロセスグローバルになったため、このメソッドは obsolete になりました。

セーフレベルについてはspec/safelevelを参照してください。

//emlist[例][ruby]{
thr = Thread.new { $SAFE = 1; sleep }
Thread.current.safe_level # => 0
thr.safe_level...
...、このメソッドは obsolete になりました。
単純に $SAFE をチェックしてください。

セーフレベルについてはspec/safelevelを参照してください。

//emlist[例][ruby]{
thr = Thread.new { $SAFE = 1; sleep }
Thread.current.safe_level # => 0
thr.safe_level...