800件ヒット
[1-100件を表示]
(0.053秒)
種類
- インスタンスメソッド (531)
- 特異メソッド (108)
- 文書 (89)
- モジュール関数 (48)
- ライブラリ (24)
ライブラリ
- ビルトイン (588)
- csv (24)
- json (24)
-
minitest
/ spec (1) -
minitest
/ unit (2) - pp (12)
- prime (24)
- singleton (12)
クラス
- BasicObject (48)
- CSV (24)
-
JSON
:: Parser (24) - Method (12)
- Module (192)
- Object (241)
- Prime (24)
- UnboundMethod (12)
モジュール
- Enumerable (24)
- Kernel (48)
-
MiniTest
:: Assertions (2) - Singleton (12)
オブジェクト
- main (24)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - === (24)
- Marshal フォーマット (12)
-
NEWS for Ruby 3
. 0 . 0 (5) - Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
-
assert
_ instance _ of (1) -
assert
_ kind _ of (1) -
bind
_ call (12) - class (12)
-
class
_ eval (24) -
class
_ variables (12) - constants (24)
-
define
_ method (24) - each (24)
- eval (24)
-
global
_ variables (12) - grep (24)
-
initialize
_ copy (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) - irb (12)
-
irb
/ completion (12) -
is
_ a? (12) -
kind
_ of? (12) -
local
_ variables (12) - method (12)
- methods (12)
-
module
_ eval (24) -
must
_ be _ instance _ of (1) - new (12)
- parameters (12)
- parse (12)
-
pretty
_ print _ instance _ variables (12) -
private
_ instance _ methods (12) -
private
_ methods (12) -
protected
_ instance _ methods (12) -
protected
_ methods (12) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
public
_ method (12) -
public
_ methods (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
respond
_ to? (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
singleton
_ method (12) -
singleton
_ method _ undefined (12) - クラス/メソッドの定義 (12)
検索結果
先頭5件
-
CSV
. instance(data = $ stdout , options = Hash . new) {|csv| . . . } -> object (18359.0) -
このメソッドは CSV.new のように CSV のインスタンスを返します。 しかし、返される値は Object#object_id と与えられたオプションを キーとしてキャッシュされます。
...このメソッドは CSV.new のように CSV のインスタンスを返します。
しかし、返される値は Object#object_id と与えられたオプションを
キーとしてキャッシュされます。
ブロックが与えられた場合、生成されたインスタンスをブ......name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
csv = CSV.instance(text, options)
csv2 = CSV.instance(text, options)
csv.object_id == csv2.object_id # => true
print csv.read
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yu... -
Singleton
. instance -> object (18302.0) -
そのクラスの唯一のインスタンスを返します。 最初に呼ばれたときはそのインスタンスを生成します。
そのクラスの唯一のインスタンスを返します。
最初に呼ばれたときはそのインスタンスを生成します。
Singleton を include したクラスで定義されますので、
正確には Singleton モジュールのメソッドではありません。 -
CSV
. instance(data = $ stdout , options = Hash . new) -> CSV (18259.0) -
このメソッドは CSV.new のように CSV のインスタンスを返します。 しかし、返される値は Object#object_id と与えられたオプションを キーとしてキャッシュされます。
...このメソッドは CSV.new のように CSV のインスタンスを返します。
しかし、返される値は Object#object_id と与えられたオプションを
キーとしてキャッシュされます。
ブロックが与えられた場合、生成されたインスタンスをブ......name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
csv = CSV.instance(text, options)
csv2 = CSV.instance(text, options)
csv.object_id == csv2.object_id # => true
print csv.read
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yu... -
Object
# instance _ variable _ set(var , value) -> object (15362.0) -
オブジェクトのインスタンス変数 var に値 value を設定します。
...value を返します。
//emlist[][ruby]{
obj = Object.new
p obj.instance_variable_set("@foo", 1) #=> 1
p obj.instance_variable_set(:@foo, 2) #=> 2
p obj.instance_variable_get(:@foo) #=> 2
//}
@see Object#instance_variable_get,Object#instance_variables,Object#instance_variable_defined?... -
Object
# instance _ variable _ get(var) -> object | nil (15356.0) -
オブジェクトのインスタンス変数の値を取得して返します。
...Foo
def initialize
@foo = 1
end
end
obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variable_get(:@bar) #=> nil
//}
@see Object#instance_variable_set,Object#instance_variables,Object#instance_variable_defined?... -
Object
# remove _ instance _ variable(name) -> object (15320.0) -
オブジェクトからインスタンス変数 name を取り除き、そのインス タンス変数に設定されていた値を返します。
...me を持たない場合に発生します。
//emlist[][ruby]{
class Foo
def foo
@foo = 1
p remove_instance_variable(:@foo) #=> 1
p remove_instance_variable(:@foo) # instance variable @foo not defined (NameError)
end
end
Foo.new.foo
//}
@see Module#remove_class_variable,Module#rem... -
Object
# instance _ variable _ defined?(var) -> bool (15255.0) -
インスタンス変数 var が定義されていたら真を返します。
..., @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true
p fred.instance_variable_defined?("@b") #=> true
p fred.instance_variable_defined?("@c") #=> false
//}
@see Object#instance_variable_get,Object#instance_variable_set,Object#instance_variables... -
Object
# instance _ of?(klass) -> bool (15237.0) -
オブジェクトがクラス klass の直接のインスタンスである時真を返します。
...。
obj.instance_of?(c) が成立する時には、常に obj.kind_of?(c) も成立します。
@param klass Classかそのサブクラスのインスタンスです。
//emlist[][ruby]{
class C < Object
end
class S < C
end
obj = S.new
p obj.instance_of?(S) # true
p obj.instance_of?(C)......# false
//}
@see Object#kind_of?,Object#class... -
Object
# instance _ variables -> [Symbol] (15231.0) -
オブジェクトのインスタンス変数名をシンボルの配列として返します。
...ンス変数名をシンボルの配列として返します。
//emlist[][ruby]{
obj = Object.new
obj.instance_eval { @foo, @bar = nil }
p obj.instance_variables
#=> [:@foo, :@bar]
//}
@see Object#instance_variable_get, Kernel.#local_variables, Kernel.#global_variables, Module.constants, Module#...