829件ヒット
[1-100件を表示]
(0.096秒)
種類
- インスタンスメソッド (667)
- 定数 (162)
ライブラリ
- ビルトイン (729)
-
minitest
/ spec (16) - pp (60)
- psych (24)
キーワード
- !~ (12)
- <=> (12)
- == (12)
- === (12)
- =~ (9)
- ARGF (12)
- ARGV (12)
-
RUBY
_ COPYRIGHT (12) -
RUBY
_ DESCRIPTION (12) -
RUBY
_ ENGINE (12) -
RUBY
_ ENGINE _ VERSION (10) -
RUBY
_ PATCHLEVEL (12) -
RUBY
_ PLATFORM (12) -
RUBY
_ RELEASE _ DATE (12) -
RUBY
_ REVISION (12) -
RUBY
_ VERSION (12) -
SCRIPT
_ LINES _ _ (12) - STDERR (12)
- TRUE (8)
-
_ dump (12) - clone (12)
-
enum
_ for (24) - eql? (12)
- equal? (12)
- freeze (12)
- frozen? (12)
- hash (12)
- initialize (12)
- inspect (12)
-
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) -
marshal
_ dump (12) -
marshal
_ load (12) - methods (12)
-
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) -
object
_ id (12) -
pretty
_ inspect (12) -
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
pretty
_ print _ inspect (12) -
pretty
_ print _ instance _ variables (12) -
private
_ methods (12) -
protected
_ methods (12) -
psych
_ to _ yaml (12) -
public
_ methods (12) -
public
_ send (24) -
remove
_ instance _ variable (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - send (24)
-
singleton
_ methods (12) - then (7)
-
to
_ a (12) -
to
_ ary (12) -
to
_ enum (24) -
to
_ int (12) -
to
_ proc (12) -
to
_ regexp (12) -
to
_ s (12) -
to
_ str (12) -
to
_ yaml (12) - trust (9)
- untrust (9)
- untrusted? (9)
-
yield
_ self (8)
検索結果
先頭5件
-
Object
# private _ methods(include _ inherited = true) -> [Symbol] (6201.0) -
そのオブジェクトが理解できる private メソッド名の一覧を返します。
...が理解できる private メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#private_instance_methods,Object#methods,Object#singleton_methods... -
Object
# to _ proc -> Proc (6201.0) -
オブジェクトの Proc への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...オブジェクトの Proc への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必要......に応じてサブクラスで定義すべきものです。
//emlist[][ruby]{
def doing
yield
end
class Foo
def to_proc
Proc.new{p 'ok'}
end
end
it = Foo.new
doing(&it) #=> "ok"
//}... -
Object
# to _ regexp -> Regexp (6201.0) -
オブジェクトの Regexp への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...オブジェクトの Regexp への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必......ての場面で代置可能であるような、
* 正規表現そのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_regexp
/[\d]+/
end
end
it = Foo.new
p Regexp.union(/^at/, it) #=> /(?-mix:^at)|(?-mix:[\d]+)/
//}... -
Object
:: TRUE -> TrueClass (6201.0) -
非推奨です。代表的な真の値。true と同じ。
...非推奨です。代表的な真の値。true と同じ。
この定数は過去との互換性のために提供されています。擬似変数 true を使ってください。
Ruby では false と nil が偽として扱われます。
偽でない値(false でも nil でもない値) は全... -
Object
# enum _ for(method = :each , *args) -> Enumerator (6101.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def rep......eat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (6101.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def rep......eat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end... -
Object
# freeze -> self (6101.0) -
オブジェクトを凍結(内容の変更を禁止)します。
...外 RuntimeError を発生させます。
いったん凍結されたオブジェクトを元に戻す方法はありません。
凍結されるのはオブジェクトであり、変数ではありません。代入などで変数の指す
オブジェクトが変化してしまうことは freez......freeze が防ぐのは、
`破壊的な操作' と呼ばれるもの一般です。変数への参照自体を凍結したい
場合は、グローバル変数なら Kernel.#trace_var が使えます。
@return self を返します。
//emlist[][ruby]{
a1 = "foo".freeze
a1 = "bar"
p a1 #=> "bar"......"foo".freeze
a2.replace("bar") # can't modify frozen String (RuntimeError)
//}
凍結を解除することはできませんが、Object#dup を使えばほぼ同じ内容の凍結されていない
オブジェクトを得ることはできます。
//emlist[][ruby]{
a = [1].freeze
p a.frozen?......外 FrozenError を発生させます。
いったん凍結されたオブジェクトを元に戻す方法はありません。
凍結されるのはオブジェクトであり、変数ではありません。代入などで変数の指す
オブジェクトが変化してしまうことは freeze......reeze
a2.replace("bar") # can't modify frozen String (FrozenError)
//}
凍結を解除することはできませんが、Object#dup を使えばほぼ同じ内容の凍結されていない
オブジェクトを得ることはできます。
//emlist[][ruby]{
a = [1].freeze
p a.frozen? #=> tr... -
Object
# frozen? -> bool (6101.0) -
オブジェクトが凍結(内容の変更を禁止)されているときに真を返します。
...オブジェクトが凍結(内容の変更を禁止)されているときに真を返します。
//emlist[][ruby]{
obj = "someone"
p obj.frozen? #=> false
obj.freeze
p obj.frozen? #=> true
//}
@see Object#freeze... -
Object
# instance _ variable _ defined?(var) -> bool (6101.0) -
インスタンス変数 var が定義されていたら真を返します。
...var が定義されていたら真を返します。
@param var インスタンス変数名を文字列か Symbol で指定します。
//emlist[][ruby]{
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true......p fred.instance_variable_defined?("@b") #=> true
p fred.instance_variable_defined?("@c") #=> false
//}
@see Object#instance_variable_get,Object#instance_variable_set,Object#instance_variables...