るりまサーチ

最速Rubyリファレンスマニュアル検索!
38件ヒット [1-38件を表示] (0.033秒)
トップページ > クエリ:new[x] > クエリ:owner[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

クラス

キーワード

検索結果

Method#owner -> Class | Module (18125.0)

このメソッドが定義されている class か module を返します。

...定義されている class か module を返します。

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.owner # => Foo

m = Foo.new.method(:puts) # => #<Method: Foo(Kernel)#puts>
m.owner # => Kernel
//}...

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (18.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

...JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

class Person
attr :name, :age

def initialize(name, age)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "...
...\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}...

Monitor#exit -> () (12.0)

MonitorMixin#mon_exit の別名です。

...ドが一つ実行を再開します。

@raise ThreadError ロックを持っていないスレッドが呼びだした場合に発生します

//emlist[例][ruby]{
require 'monitor'
mon = Monitor.new
mon.enter
mon.enter
mon.exit
mon.exit
mon.exit # => current thread not owner (ThreadError)
//}...

Monitor#mon_exit -> () (12.0)

モニターのロックを解放します。

...ドが一つ実行を再開します。

@raise ThreadError ロックを持っていないスレッドが呼びだした場合に発生します

//emlist[例][ruby]{
require 'monitor'
mon = Monitor.new
mon.enter
mon.enter
mon.exit
mon.exit
mon.exit # => current thread not owner (ThreadError)
//}...