るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

TracePoint#self -> object (21315.0)

イベントを発生させたオブジェクトを返します。

...イベントを発生させたオブジェクトを返します。

以下のようにする事で同じ値を取得できます。


//emlist[例][ruby]{
t
race.binding.eval('self')
//}

@see TracePoint#binding...
...返します。

以下のようにする事で同じ値を取得できます。

なお、self メソッドは binding が nil になる :c_call および :c_return イベントに対しても正しく動作します。

//emlist[例][ruby]{
t
race.binding.eval('self')
//}

@see TracePoint#binding...

Integer#>(other) -> bool (21220.0)

比較演算子。数値として大きいか判定します。

...演算子。数値として大きいか判定します。

@param other 比較対象の数値
@return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 > 0 # => true
1 > 1 # => false
//}...

Float#>(other) -> bool (21214.0)

比較演算子。数値として大きいか判定します。

...として大きいか判定します。

@param other 比較対象の数値
@return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。

//emlist[例][ruby]{
3.14 > 3.1415 # => false
3.14 >= 3.1415 # => false
//}...

Module#>(other) -> bool | nil (18270.0)

比較演算子。 self が other の先祖である場合、true を返します。 self が other の子孫か同一クラスである場合、false を返します。

... self が other の先祖である場合、true を返します。
self
が other の子孫か同一クラスである場合、false を返します。

継承関係にないクラス同士の比較では
nil を返します。

@param other 比較対象のモジュールやクラス

@raise Type...
...or other がクラスやモジュールではない場合に発生します。

@see Module#<

//emlist[例][ruby]{
module Awesome; end
module Included
include Awesome
end
module Prepended
prepend Awesome
end

Included.ancestors # => [Included, Awesome]
Awesome > Included # => true
Included > Aw...
...esome # => false

Prepended.ancestors # => [Awesome, Prepended]
Awesome > Prepended # => true
Prepended > Awesome # => false

Awesome > Awesome # => false
Awesome > Object # => nil
//}...

Hash#>(other) -> bool (18236.0)

other が self のサブセットである場合に真を返します。

...other が self のサブセットである場合に真を返します。

@param other 自身と比較したい Hash オブジェクトを指定します。

//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 > h2 # => false
h2 > h1 # => true
h1 > h1 # => false
//}

@see Hash#<=,...
...Hash#<, Hash#>=...

絞り込み条件を変える

Fixnum#>(other) -> bool (18208.0)

比較演算子。数値として大きいか判定します。

...比較演算子。数値として大きいか判定します。

@param other 比較対象の数値
@return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。...

Module#protected(*name) -> self (12403.0)

メソッドを protected に設定します。

...ッドを protected に設定します。

引数なしのときは今後このクラスまたはモジュール定義内で新規に定義さ
れるメソッドを protected に設定します。

引数が与えられた時には引数によって指定されたメソッドを protected
に設定...
...します。

可視性については d:spec/def#limit を参照して下さい。

@param name 0 個以上の String または Symbol を指定します。

@raise NameError 存在しないメソッド名を指定した場合に発生します。


@see Module#protected_method_defined?...

Object#itself -> object (12318.0)

self を返します。

...
self
を返します。

//emlist[][ruby]{
string = 'my string' # => "my string"
string.itself.object_id == string.object_id # => true
//}...

Thread#terminate -> self (9405.0)

スレッドの実行を終了させます。終了時に ensure 節が実行されます。

...す。

ただし、スレッドは終了処理中(aborting)にはなりますが、
直ちに終了するとは限りません。すでに終了している場合は何もしません。このメソッドにより
終了したスレッドの Thread#value の返り値は不定です。
自身がメ...
...exit(0)
により終了します。

Kernel.#exit と違い例外 SystemExit を発生しません。

t
h1 = Thread.new do
begin
sleep 10
ensure
p "this will be displayed"
end
end

sleep 0.1
t
h1.kill

#=> "this will be displayed"

@see Kernel.#exit, Kernel.#exit!...

Object#yield_self -> Enumerator (9356.0)

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

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

//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}

値をメソッドチェインのパイプラインに次々と渡すの...
...です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します...
...
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

絞り込み条件を変える

Object#yield_self {|x| ... } -> object (9356.0)

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

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

//emlist[例][ruby]{
"my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}

値をメソッドチェインのパイプラインに次々と渡すの...
...です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します...
...
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

Time#<=>(other) -> -1 | 0 | 1 | nil (9342.0)

self と other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、 小さい場合は -1 を返します。比較できない場合は、nil を返します。

...
self
と other の時刻を比較します。self の方が大きい場合は 1 を、等しい場合は 0 を、
小さい場合は -1 を返します。比較できない場合は、nil を返します。

@param other 自身と比較したい時刻を Time オブジェクトで指定します。...
...emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00 +0900
p t <=> t2 # => -1
p t2 <=> t # => 1
//}

//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 0.1 # => 2000...
...-01-01 00:00:00 +0900
p t.nsec # => 0
p t2.nsec # => 100000000
p t <=> t2 # => -1
p t2 <=> t # => 1
p t <=> t # => 0
//}...

Time#localtime -> self (9340.0)

タイムゾーンを地方時に設定します。

...am utc_offset タイムゾーンを地方時に設定する代わりに協定世界時との
時差を、秒を単位とする整数か、"+HH:MM" "-HH:MM" 形式
の文字列で指定します。

T
ime#localtime, Time#gmtime の挙動はシステムの
localtime(...
...存します。Time クラ
スでは時刻を起算時からの経過秒数として保持していますが、ある特定の
時刻までの経過秒は、システムがうるう秒を勘定するかどうかによって異
なる場合があります。システムを越えて Time オブジェ...
...

//emlist[][ruby]{
p t = Time.utc(2000, "jan", 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
p t.utc? # => true
p t.localtime # => 2000-01-02 05:15:01 +0900
p t.utc? # => false

p t.localtime("+09:00")...
<< 1 2 3 ... > >>