![条件を削除 [x]](/images/drop-condition-icon.png)
種類
- インスタンスメソッド (629)
- 定数 (163)
- 特異メソッド (16)
ライブラリ
- ビルトイン (728)
-
minitest
/ spec (16) - pp (40)
- psych (24)
キーワード
- !~ (8)
- <=> (8)
- == (8)
- === (8)
- =~ (8)
- ARGF (8)
- ARGV (8)
- DATA (8)
- ENV (8)
- FALSE (7)
- NIL (7)
-
RUBY
_ COPYRIGHT (8) -
RUBY
_ DESCRIPTION (8) -
RUBY
_ ENGINE (8) -
RUBY
_ ENGINE _ VERSION (6) -
RUBY
_ PATCHLEVEL (8) -
RUBY
_ PLATFORM (8) -
RUBY
_ RELEASE _ DATE (8) -
RUBY
_ REVISION (8) -
RUBY
_ VERSION (8) -
SCRIPT
_ LINES _ _ (8) - STDERR (8)
- STDIN (8)
- STDOUT (8)
-
TOPLEVEL
_ BINDING (8) - TRUE (7)
-
_ dump (8) - class (8)
- clone (8)
-
define
_ singleton _ method (16) - display (8)
- dup (8)
-
enum
_ for (16) - eql? (8)
- equal? (8)
- extend (8)
- freeze (8)
- frozen? (8)
- hash (8)
- initialize (8)
-
initialize
_ copy (8) - inspect (8)
-
instance
_ of? (8) -
instance
_ variable _ defined? (8) -
instance
_ variable _ get (8) -
instance
_ variable _ set (8) -
instance
_ variables (8) -
is
_ a? (8) - itself (7)
-
kind
_ of? (8) -
marshal
_ dump (8) -
marshal
_ load (8) - method (8)
- methods (8)
-
must
_ be (1) -
must
_ be _ close _ to (1) -
must
_ be _ empty (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) -
must
_ match (1) -
must
_ raise (1) -
must
_ respond _ to (1) -
must
_ send (1) -
must
_ throw (1) - new (8)
- nil? (8)
-
object
_ id (8) -
pretty
_ inspect (8) -
pretty
_ print (8) -
pretty
_ print _ cycle (8) -
pretty
_ print _ inspect (8) -
pretty
_ print _ instance _ variables (8) -
private
_ methods (8) -
protected
_ methods (8) -
psych
_ to _ yaml (8) -
public
_ method (8) -
public
_ methods (8) -
public
_ send (8) -
remove
_ instance _ variable (8) -
respond
_ to? (8) -
respond
_ to _ missing? (8) - send (16)
-
singleton
_ class (8) -
singleton
_ method (8) -
singleton
_ methods (8) - taint (8)
- tainted? (8)
- tap (8)
- then (6)
-
to
_ a (8) -
to
_ ary (8) -
to
_ enum (16) -
to
_ hash (8) -
to
_ int (8) -
to
_ io (8) -
to
_ proc (8) -
to
_ regexp (8) -
to
_ s (8) -
to
_ str (8) -
to
_ yaml (8) - trust (8)
- untaint (8)
- untrust (8)
- untrusted? (8)
-
yaml
_ tag (8) -
yield
_ self (8)
検索結果
先頭5件
-
Object
# !~(other) -> bool (1.0) -
自身が other とマッチしない事を判定します。
...マッチしない事を判定します。
self#=~(obj) を反転した結果と同じ結果を返します。
@param other 判定するオブジェクトを指定します。
//emlist[例][ruby]{
obj = 'regexp'
p (obj !~ /re/) # => false
obj = nil
p (obj !~ /re/) # => true
//}
@see Object#=~... -
Object
# <=>(other) -> 0 | nil (1.0) -
self === other である場合に 0 を返します。そうでない場合には nil を返します。
...ある場合に 0 を返します。そうでない場合には nil を返します。
//emlist[例][ruby]{
a = Object.new
b = Object.new
a <=> a # => 0
a <=> b # => nil
//}
@see Object#===... -
Object
# ==(other) -> bool (1.0) -
オブジェクトと other が等しければ真を返します。
...。
デフォルトでは equal? と同じオブジェクト
の同一性判定になっています。
@param other 比較するオブジェクトです。
p("foo" == "bar") #=> false
p("foo" == "foo") #=> true
p(4 == 4) #=> true
p(4 == 4.0) #=> true
@see Object#equal?,Object#eql?... -
Object
# ===(other) -> bool (1.0) -
メソッド Object#== の別名です。 case 式で使用されます。このメソッドは case 式での振る舞いを考慮して、 各クラスの性質に合わせて再定義すべきです。
...メソッド Object#== の別名です。
case 式で使用されます。このメソッドは case 式での振る舞いを考慮して、
各クラスの性質に合わせて再定義すべきです。
一般的に所属性のチェックを実現するため適宜再定義されます。
when......s. But don't hit."
else
"unknown"
end
end
puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
@see Object#==, Range#===, Module#===, Regexp#===, Enumerable#grep... -
Object
# =~(other) -> nil (1.0) -
右辺に正規表現オブジェクトを置いた正規表現マッチ obj =~ /RE/ をサポートするためのメソッドです。常に nil を返します。
右辺に正規表現オブジェクトを置いた正規表現マッチ obj =~ /RE/
をサポートするためのメソッドです。常に nil を返します。
このメソッドは Ruby 2.6 から deprecated です。
この定義により、=~ が再定義されたオブジェクトでは正常にマッチを行い、
それ以外のものは nil を返すようになります。
@param other 任意のオブジェクトです。結果に影響しません。
//emlist[例][ruby]{
obj = 'regexp'
p(obj =~ /re/) #=> 0
obj = nil
p(obj =~ /re/) #=> nil
//}
...右辺に正規表現オブジェクトを置いた正規表現マッチ obj =~ /RE/
をサポートするためのメソッドです。常に nil を返します。
このメソッドは Ruby 2.6 から deprecated です。
意図せずに Array などに対して呼ばれた時にバグの原因になっていたため、
代わりに NilClass#=~ が定義されています。
@param other 任意のオブジェクトです。結果に影響しません。
//emlist[例][ruby]{
obj = 'regexp'
p(obj =~ /re/) #=> 0
obj = nil
p(obj =~ /re/) #=> nil
... -
Object
# _ dump(limit) -> String (1.0) -
Marshal.#dump において出力するオブジェクトがメソッド _dump を定義している場合には、そのメソッドの結果が書き出されます。
...ド _dump
を定義している場合には、そのメソッドの結果が書き出されます。
バージョン1.8.0以降ではObject#marshal_dump, Object#marshal_loadの使用
が推奨されます。 Marshal.dump するオブジェクトが _dump と marshal_dump の両方の
メソッド......い場合や拡張ライブラリで定義し
たクラスのインスタンスがインスタンス変数以外に情報を保持する場合に
利用します。(例えば、クラス Time は、_dump/_load を定義して
います)
@see Object#marshal_dump, Object#marshal_load, Class#_load... -
Object
# class -> Class (1.0) -
レシーバのクラスを返します。
...p "ruby".class #=> String
p 100.class #=> Fixnum
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
@see Class#superclass,Object#kind_of?,Object#instance_of?......p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Object
# clone -> object (1.0) -
オブジェクトの複製を作成して返します。
...) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# clone(freeze: true) -> object (1.0) -
オブジェクトの複製を作成して返します。
...) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (1.0) -
self に特異メソッド name を定義します。
self に特異メソッド name を定義します。
@param symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_meth... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (1.0) -
self に特異メソッド name を定義します。
self に特異メソッド name を定義します。
@param symbol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_meth... -
Object
# display(out = $ stdout) -> nil (1.0) -
オブジェクトを out に出力します。
...ます。
class Object
def display(out = $stdout)
out.write self
nil
end
end
@param out 出力先のIOオブジェクトです。指定しない場合は標準出力に出力されます。
@return nil を返します。
Object.new.display #=> #<Object:0xbb0210>
@see $s... -
Object
# dup -> object (1.0) -
オブジェクトの複製を作成して返します。
...) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# enum _ for(method = :each , *args) -> Enumerator (1.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects ...