1165件ヒット
[1-100件を表示]
(0.068秒)
種類
- インスタンスメソッド (967)
- 特異メソッド (126)
- モジュール関数 (60)
- 変数 (12)
クラス
-
ARGF
. class (240) - Array (24)
- Data (6)
- FalseClass (24)
- File (12)
- IO (48)
- Method (36)
- Module (396)
- NilClass (19)
- Object (132)
- Struct (48)
- Thread (12)
-
Thread
:: Backtrace :: Location (48) - TracePoint (12)
- TrueClass (24)
- UnboundMethod (12)
キーワード
-
$ FILENAME (12) - === (12)
- =~ (7)
- [] (12)
-
_ dump (12) -
absolute
_ path (12) - arity (12)
- attr (12)
-
attr
_ accessor (4) -
attr
_ reader (4) -
attr
_ writer (4) - autoload (24)
- autoload? (12)
- backtrace (12)
-
base
_ label (12) - class (12)
-
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) - clone (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - define (6)
-
define
_ method (24) -
define
_ singleton _ method (24) - dump (24)
- dup (12)
- filename (12)
-
for
_ fd (12) - getc (12)
- gets (36)
-
inplace
_ mode (12) - inspect (84)
-
instance
_ method (12) -
method
_ defined? (12) - name (12)
- new (60)
- open (24)
- path (24)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ class _ method (24) -
public
_ constant (12) -
public
_ method (12) -
public
_ method _ defined? (12) - putc (12)
- read (12)
-
read
_ nonblock (12) - readchar (12)
- readline (36)
- readpartial (12)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ method (12) -
set
_ encoding (36) -
singleton
_ class (12) -
singleton
_ method (12) -
source
_ location (12) -
to
_ s (96) -
to
_ str (12) -
undef
_ method (12)
検索結果
先頭5件
-
Kernel
. # String(arg) -> String (18238.0) -
引数を文字列(String)に変換した結果を返します。
...引数を文字列(String)に変換した結果を返します。
arg.to_s を呼び出して文字列に変換します。
arg が文字列の場合、何もせず arg を返します。
@param arg 変換対象のオブジェクトです。
@raise TypeError to_s の返り値が文字列でなけ......れば発生します。
//emlist[例][ruby]{
class Foo
def to_s
"hogehoge"
end
end
arg = Foo.new
p String(arg) #=> "hogehoge"
//}
@see Object#to_s,String... -
Object
# class -> Class (6264.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Object
# singleton _ class -> Class (6252.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...れ NilClass, TrueClass,
FalseClass を返します。
@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... -
Module
# public _ class _ method(*name) -> self (6140.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMethodError: private method `foo' called for Foo:Class
F......oo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# public _ class _ method(names) -> self (6140.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMethodError: private method `foo' called for Foo:Class
F......oo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# class _ variable _ defined?(name) -> bool (6139.0) -
name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。
...す。
@param name Symbol か String を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
end
Fred.class_variable_defined?(:@@foo) #=> true
Fred.class_variable_defined?(:@@bar) #=> false
Fred.class_variable_defined?('@@foo') #=> true
Fred.class_variable_defined?('@@bar')... -
Module
# private _ class _ method(*name) -> self (6134.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...e 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:foo) # => false
Foo.private_class_method(:foo) #......=> Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(names) -> self (6134.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...e 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:foo) # => false
Foo.private_class_method(:foo) #......=> Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# remove _ class _ variable(name) -> object (6127.0) -
引数で指定したクラス変数を取り除き、そのクラス変数に設定さ れていた値を返します。
...引数で指定したクラス変数を取り除き、そのクラス変数に設定さ
れていた値を返します。
@param name String または Symbol を指定します。
@return 引数で指定されたクラス変数に設定されていた値を返します。
@raise NameError 引数......ジュールやクラスに定義されていない場合に発生します。
//emlist[例][ruby]{
class Foo
@@foo = 1
remove_class_variable(:@@foo) # => 1
p @@foo # => uninitialized class variable @@foo in Foo (NameError)
end
//}
@see Module#remove_const, Object#remove_instance_variabl...