78件ヒット
[1-78件を表示]
(0.129秒)
別のキーワード
クラス
- File (12)
- Method (12)
- Monitor (18)
- Pathname (12)
- UnboundMethod (12)
モジュール
検索結果
先頭5件
-
UnboundMethod
# owner -> Class | Module (18126.0) -
このメソッドが定義されている class か module を返します。
...このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//}... -
Method
# owner -> Class | Module (18120.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
//}... -
Pathname
# chown(owner , group) -> Integer (130.0) -
File.chown(owner, group, self.to_s) と同じです。
...File.chown(owner, group, self.to_s) と同じです。
@param owner オーナーを指定します。
@param group グループを指定します。
//emlist[例][ruby]{
require 'pathname'
Pathname('testfile').stat.uid # => 501
Pathname('testfile').chown(502, 12)
Pathname('testfile').stat.ui... -
File
# chown(owner , group) -> 0 (114.0) -
ファイルのオーナーとグループを変更します。
...。
所有者の変更に成功した場合は 0 を返します。変更に失敗した場合は
例外 Errno::EXXX が発生します。
@param owner chown(2) と同様に数値で指定します。nil または -1 を指定することで、オーナーを現在のままにすることができ......rror 自身が close されている場合に発生します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例][ruby]{
File.open("testfile") { |f| f.chown(502, 1000) } # => 0
File.stat("testfile").uid # => 502
File.stat("testfile").gid... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (13.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
...します。
//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::Ge... -
Monitor
# exit -> () (13.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 -> () (13.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)
//}...