ライブラリ
- ビルトイン (619)
-
minitest
/ spec (9) - pp (24)
- psych (24)
キーワード
- !~ (12)
- <=> (12)
- == (12)
- === (12)
- =~ (9)
-
_ dump (12) - class (12)
- clone (12)
-
define
_ singleton _ method (24) - display (12)
- dup (12)
- eql? (12)
- equal? (12)
- extend (12)
- freeze (12)
- frozen? (12)
- initialize (12)
-
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) -
is
_ a? (12) - itself (12)
-
kind
_ of? (12) -
marshal
_ dump (12) -
marshal
_ load (12) - methods (12)
-
must
_ be _ close _ to (1) -
must
_ be _ instance _ of (1) -
must
_ be _ kind _ of (1) -
must
_ be _ nil (1) -
must
_ be _ same _ as (1) -
must
_ be _ within _ delta (1) -
must
_ be _ within _ epsilon (1) -
must
_ equal (1) -
must
_ include (1) - nil? (12)
-
pretty
_ print _ cycle (12) -
pretty
_ print _ instance _ variables (12) -
private
_ methods (12) -
protected
_ methods (12) -
psych
_ to _ yaml (12) -
public
_ method (12) -
public
_ methods (12) -
public
_ send (24) -
remove
_ instance _ variable (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) -
singleton
_ class (12) -
singleton
_ method (12) -
singleton
_ methods (12) - taint (9)
- tainted? (9)
- tap (12)
-
to
_ yaml (12) - trust (9)
- untaint (9)
- untrust (9)
- untrusted? (9)
-
yield
_ self (16)
検索結果
先頭5件
-
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...