1090件ヒット
[1-100件を表示]
(0.041秒)
種類
- 定数 (970)
- インスタンスメソッド (108)
- モジュール関数 (12)
クラス
- BasicObject (36)
- Encoding (970)
- Module (12)
- Object (60)
モジュール
- Process (12)
キーワード
- CP1251 (12)
- CP1256 (12)
- CP1258 (12)
- CP720 (5)
- CP737 (12)
- CP775 (12)
- CP852 (12)
- CP855 (12)
- CP857 (12)
- CP860 (12)
- CP861 (12)
- CP862 (12)
- CP863 (12)
- CP864 (12)
- CP865 (12)
- CP866 (12)
- CP869 (12)
- CP878 (12)
- IBM720 (5)
- IBM737 (12)
- IBM775 (12)
- IBM852 (12)
- IBM855 (12)
- IBM857 (12)
- IBM860 (12)
- IBM861 (12)
- IBM862 (12)
- IBM863 (12)
- IBM864 (12)
- IBM865 (12)
- IBM866 (12)
- IBM869 (12)
-
ISO8859
_ 10 (12) -
ISO8859
_ 11 (12) -
ISO8859
_ 13 (12) -
ISO8859
_ 14 (12) -
ISO8859
_ 16 (12) -
ISO8859
_ 2 (12) -
ISO8859
_ 3 (12) -
ISO8859
_ 4 (12) -
ISO8859
_ 5 (12) -
ISO8859
_ 6 (12) -
ISO8859
_ 7 (12) -
ISO8859
_ 8 (12) -
ISO8859
_ 9 (12) -
ISO
_ 8859 _ 10 (12) -
ISO
_ 8859 _ 11 (12) -
ISO
_ 8859 _ 13 (12) -
ISO
_ 8859 _ 14 (12) -
ISO
_ 8859 _ 16 (12) -
ISO
_ 8859 _ 2 (12) -
ISO
_ 8859 _ 3 (12) -
ISO
_ 8859 _ 4 (12) -
ISO
_ 8859 _ 5 (12) -
ISO
_ 8859 _ 6 (12) -
ISO
_ 8859 _ 7 (12) -
ISO
_ 8859 _ 8 (12) -
ISO
_ 8859 _ 9 (12) -
KOI8
_ R (12) -
KOI8
_ U (12) - MACCENTEURO (12)
- MACCROATIAN (12)
- MACCYRILLIC (12)
- MACGREEK (12)
- MACICELAND (12)
- MACROMAN (12)
- MACROMANIA (12)
- MACTURKISH (12)
- MacCentEuro (12)
- MacCroatian (12)
- MacCyrillic (12)
- MacGreek (12)
- MacIceland (12)
- MacRoman (12)
- MacRomania (12)
- MacTurkish (12)
-
WINDOWS
_ 1251 (12) -
WINDOWS
_ 1256 (12) -
WINDOWS
_ 1258 (12) -
Windows
_ 1251 (12) -
Windows
_ 1256 (12) -
Windows
_ 1258 (12) -
clock
_ gettime (12) -
define
_ singleton _ method (24) -
singleton
_ class (12) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12)
検索結果
先頭5件
-
BasicObject
# singleton _ method _ added(name) -> object (6102.0) -
特異メソッドが追加された時にインタプリタから呼び出されます。
...emlist[例][ruby]{
class Foo
def singleton_method_added(name)
puts "singleton method \"#{name}\" was added"
end
end
obj = Foo.new
def obj.foo
end
#=> singleton method "foo" was added
//}
@see Module#method_added,BasicObject#singleton_method_removed,BasicObject#singleton_method_undefined... -
BasicObject
# singleton _ method _ removed(name) -> object (6102.0) -
特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。
...def singleton_method_removed(name)
puts "singleton method \"#{name}\" was removed"
end
end
obj = Foo.new
def obj.foo
end
class << obj
remove_method :foo
end
#=> singleton method "foo" was removed
//}
@see Module#method_removed,BasicObject#singleton_method_added,BasicObject#singleton_m... -
BasicObject
# singleton _ method _ undefined(name) -> object (6102.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end
obj = Foo.new
def obj.foo
end
def obj.bar
end
class << obj
undef_method :foo
end
obj.instance_eval {undef bar}
#=> singleton method "foo" was undefined
# singleton method "bar"......was undefined
//}
@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef... -
Module
# singleton _ class? -> bool (6102.0) -
self が特異クラスの場合に true を返します。そうでなければ false を返し ます。
...self が特異クラスの場合に true を返します。そうでなければ false を返し
ます。
//emlist[例][ruby]{
class C
end
C.singleton_class? # => false
C.singleton_class.singleton_class? # => true
//}... -
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (6102.0) -
self に特異メソッド name を定義します。
...t[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (6102.0) -
self に特異メソッド name を定義します。
...t[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Object
# singleton _ class -> Class (6102.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #=> #<Class:String>
nil.singleton_class #=> NilClass
//}
@see Object#class... -
Object
# singleton _ method(name) -> Method (6102.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
..."Hello, @iv = #{@iv}"
end
end
k = Demo.new(99)
def k.hi
"Hi, @iv = #{@iv}"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}
@see Module#instance_method, Method, BasicObject#__send_... -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (6102.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
...や、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。
singleton_methods(false) は、Object#methods(false) と同じです。
@param inherited_too 継承した特異メソッドを含める場合は真を......nd
public; def public_self() end
end
# あるオブジェクトの特異メソッドの一覧を得る。
p obj.singleton_methods(false)
p obj.methods(false)
p Foo.singleton_methods(false)
#実行結果
[:protected_self, :public_self]
[:protected_self, :public_self]
[:protected_class_foo,......るよう true を指定したが、
# Object のクラスメソッドは一覧から排除している。
p obj.singleton_methods(true)
p Foo.singleton_methods(true) - Object.singleton_methods(true)
#実行結果
[:protected_self, :public_self, :protected_bar, :public_bar]
[:protected_class_foo,...
