別のキーワード
ライブラリ
- ビルトイン (408)
- delegate (12)
- erb (12)
-
fiddle
/ import (12) - forwardable (48)
- json (12)
-
rdoc
/ context (24) -
rdoc
/ generator / darkfish (12) -
rdoc
/ generator / ri (12) -
rubygems
/ specification (12) - win32ole (36)
クラス
- BasicObject (84)
- Class (24)
- ERB (12)
-
Gem
:: Specification (12) - Object (156)
-
RDoc
:: Context (24) -
RDoc
:: Generator :: Darkfish (12) -
RDoc
:: Generator :: RI (12) -
Thread
:: Backtrace :: Location (48) - WIN32OLE (12)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (96)
-
Fiddle
:: Importer (12) - Forwardable (48)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (12)
キーワード
- ! (12)
- != (12)
- == (12)
- DelegateClass (12)
-
_ dump (12) -
absolute
_ path (12) - allocate (12)
-
base
_ label (12) - clone (12)
-
def
_ class (12) -
def
_ delegator (12) -
def
_ instance _ delegator (12) -
default
_ event _ sources (12) - delegate (12)
- dup (12)
- handler= (12)
-
initialize
_ classes _ and _ modules (12) -
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) -
initialize
_ methods _ etc (12) - inspect (24)
-
instance
_ delegate (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
marshal
_ dump (12) - max (48)
-
method
_ missing (12) - min (48)
- new (12)
-
ole
_ activex _ initialize (12) -
singleton
_ method (12) - struct (12)
-
to
_ json (12) -
to
_ s (24) -
yaml
_ initialize (12)
検索結果
先頭5件
-
BasicObject
# ==(other) -> bool (7.0) -
オブジェクトが other と等しければ真を、さもなくば偽を返します。
...るオブジェクト
@return other が self と同値であれば真、さもなくば偽
//emlist[例][ruby]{
class Person < BasicObject
def initialize(name, age)
@name = name
@age = age
end
end
tanaka1 = Person.new("tanaka", 24)
tanaka2 = Person.new("tanaka", 24)
tanaka1 == tanaka1... -
BasicObject
# instance _ eval {|obj| . . . } -> object (7.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...ます。
スタックトレースの表示などを差し替えることができます。
//emlist[例][ruby]{
class Foo
def initialize data
@key = data
end
private
def do_fuga
p 'secret'
end
end
some = Foo.new 'XXX'
some.instance_eval{p @key} #=> "XXX"
some.insta... -
BasicObject
# instance _ eval(expr , filename = "(eval)" , lineno = 1) -> object (7.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...ます。
スタックトレースの表示などを差し替えることができます。
//emlist[例][ruby]{
class Foo
def initialize data
@key = data
end
private
def do_fuga
p 'secret'
end
end
some = Foo.new 'XXX'
some.instance_eval{p @key} #=> "XXX"
some.insta... -
BasicObject
# instance _ exec(*args) {|*vars| . . . } -> object (7.0) -
与えられたブロックをレシーバのコンテキストで実行します。
...スすることができます。
@param args ブロックパラメータに渡す値です。
//emlist[例][ruby]{
class KlassWithSecret
def initialize
@secret = 99
end
end
k = KlassWithSecret.new
# 以下で x には 5 が渡される
k.instance_exec(5) {|x| @secret + x } #=> 104
//}... -
BasicObject
# method _ missing(name , *args) -> object (7.0) -
呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。
...sing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。
//emlist[例][ruby]{
class Foo
def initialize(data)
@data = data
end
def method_missing(name, lang)
if name.to_s =~ /\Afind_(\d+)_in\z/
if @data[lang]
p @data[lang... -
Class
# allocate -> object (7.0) -
自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。
...ェクトは
自身のインスタンスであること以外には何も特性を持ちません。
//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end
def initialized?
@initialized || false
end
end
klass.allocate.initialized? #=> false
//}... -
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (7.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
...m superklass 無名クラスのスーパークラス
@param methodname メソッド名
//emlist[例][ruby]{
require 'erb'
class MyClass_
def initialize(arg1, arg2)
@arg1 = arg1; @arg2 = arg2
end
end
filename = 'example.rhtml' # @arg1 と @arg2 が使われている example.rhtml
erb =... -
Enumerable
# max {|a , b| . . . } -> object | nil (7.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...peError ブロックが整数以外を返したときに発生します。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),... -
Enumerable
# max(n) {|a , b| . . . } -> Array (7.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...peError ブロックが整数以外を返したときに発生します。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),...