るりまサーチ

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

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l

検索結果

<< < ... 5 6 7 >>

Object#respond_to_missing?(symbol, include_private) -> bool (102.0)

自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。

...身が symbol で表されるメソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。

Object
#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。

BasicObject#method_missi...
...false を返します。

@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます

//emlist[例][ruby]{
class Sample
def method_missing(name, *args)
if name =~ /^to_*/
[name, *args] # => [:to_sample, "sample args1...
...", "sample args2"]
return
else
super
end
end

def respond_to_missing?(sym, include_private)
(sym =~ /^to_*/) ? true : super
end
end

s = Sample.new
s.to_sample("sample args1", "sample args2")
s.respond_to?(:to_sample) # => true
s.respond_to?(:sample) # => false
//}...

Object#taint -> self (102.0)

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

...はspec/safelevelを参照してください。

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

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

some.taint
p some.tainted? #=> true
eval(some) # Insecure operation - eval (SecurityError)

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

p ENV['OS'].tainted? #=> true
//}

@see Object#tainted?,Object#untaint,Object#freeze...
...何もせずに self を返します。
このメソッドは Ruby 2.7 から deprecated で、Ruby 3.2 で削除予定です。


@see Object#tainted?,Object#untaint,Object#freeze...

Object#tainted? -> bool (102.0)

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

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

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

@see Object#taint,Object#untaint...

Object#tainted? -> false (102.0)

常に false を返します。 全てのオブジェクトは常に untainted 扱いになりました。

...常に false を返します。
全てのオブジェクトは常に untainted 扱いになりました。


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

@see Object#taint,Object#untaint...

Object#tap {|x| ... } -> self (102.0)

self を引数としてブロックを評価し、self を返します。

...self を引数としてブロックを評価し、self を返します。

メソッドチェインの途中で直ちに操作結果を表示するために
メソッドチェインに "入り込む" ことが、このメソッドの主目的です。

//emlist[][ruby]{
(1..10) .ta...
...p {|x| puts "original: #{x}" }
.to_a .tap {|x| puts "array: #{x}" }
.select {|x| x.even? } .tap {|x| puts "evens: #{x}" }
.map {|x| x*x } .tap {|x| puts "squares: #{x}" }
//}...
...p {|x| puts "original: #{x}" }
.to_a .tap {|x| puts "array: #{x}" }
.select {|x| x.even? } .tap {|x| puts "evens: #{x}" }
.map {|x| x*x } .tap {|x| puts "squares: #{x}" }
//}

@see Object#yield_self...

絞り込み条件を変える

Object#trust -> self (102.0)

このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#untaint と同じ動作をします。

...このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object
#untaint と同じ動作をします。


@see Object#untrusted?,Object#untrust...

Object#untaint -> self (102.0)

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

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


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

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


@see Object#taint,Object#tainted?...
...何もせずに self を返します。

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


@see Object#taint,Object#tainted?...

Object#untrust -> self (102.0)

このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#taint と同じ動作をします。

...このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object
#taint と同じ動作をします。


@see Object#trust,Object#untrusted?...

Object#untrusted? -> bool (102.0)

このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#tainted? と同じ動作をします。

...このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object
#tainted? と同じ動作をします。


@see Object#trust,Object#untrust...

Object#untrusted? -> false (102.0)

このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#tainted? と同じ動作をします。

...このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object
#tainted? と同じ動作をします。


@see Object#trust,Object#untrust...

絞り込み条件を変える

<< < ... 5 6 7 >>