ライブラリ
- ビルトイン (167)
- delegate (33)
- fileutils (11)
- forwardable (44)
- json (352)
-
minitest
/ unit (1) - openssl (11)
- rake (22)
-
rdoc
/ code _ object (11) -
rdoc
/ context (22) -
rdoc
/ stats (22) -
shell
/ command-processor (6) -
syslog
/ logger (11) - win32ole (77)
クラス
- Delegator (33)
-
MiniTest
:: Unit :: TestCase (1) - Module (60)
- Object (77)
-
OpenSSL
:: SSL :: SSLContext (11) - Proc (5)
-
RDoc
:: CodeObject (11) -
RDoc
:: Context (22) -
RDoc
:: Stats (22) -
Rake
:: FileList (22) - Refinement (3)
-
Shell
:: CommandProcessor (6) -
Syslog
:: Logger (11) - WIN32OLE (44)
-
WIN32OLE
_ TYPE (22)
モジュール
- FileUtils (11)
- Forwardable (22)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - SingleForwardable (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
ARRAY
_ METHODS (11) - Array (22)
-
DELEGATING
_ METHODS (11) - Extend (22)
- FalseClass (22)
- Float (22)
- Hash (22)
- Integer (22)
- METHODS (22)
-
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NilClass (22)
- NoDelegateMethods (6)
- Object (22)
- Ruby用語集 (11)
- String (22)
- TrueClass (22)
- UnboundMethod (11)
-
WIN32OLE
_ METHOD (11) -
def
_ delegators (22) -
def
_ instance _ delegators (11) -
def
_ single _ delegators (11) -
default
_ event _ sources (11) -
import
_ methods (3) -
initialize
_ methods _ etc (11) -
ins
_ methods _ i (11) -
ins
_ methods _ priv _ i (11) -
ins
_ methods _ prot _ i (11) -
instance
_ methods (11) - irb (11)
-
json
_ create (11) -
make
_ methods (11) -
num
_ methods (11) -
num
_ methods= (11) -
ole
_ func _ methods (11) -
ole
_ get _ methods (11) -
ole
_ methods (22) -
ole
_ put _ methods (11) -
private
_ instance _ methods (11) -
private
_ methods (11) -
protected
_ instance _ methods (11) -
protected
_ methods (22) -
public
_ instance _ methods (11) -
public
_ methods (22) -
rb
_ class _ instance _ methods (11) -
rb
_ class _ private _ instance _ methods (11) -
rb
_ class _ protected _ instance _ methods (11) -
rb
_ obj _ methods (11) -
rb
_ obj _ private _ methods (11) -
rb
_ obj _ protected _ methods (11) -
rb
_ obj _ singleton _ methods (11) - rdoc (11)
-
remove
_ methods _ etc (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
ruby2
_ keywords (10) - send (22)
-
set
_ visibility _ for (11) -
singleton
_ methods (11) -
test
_ methods (1) -
to
_ json (99) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) -
undef
_ method (11)
検索結果
先頭5件
-
Method (44136.0)
-
Object#method によりオブジェクト化され たメソッドオブジェクトのクラスです。
...ject#method によりオブジェクト化され
たメソッドオブジェクトのクラスです。
メソッドの実体(名前でなく)とレシーバの組を封入します。
Proc オブジェクトと違ってコンテキストを保持しません。
=== Proc との差
Method は......は使い捨てに向き、Method は何度も繰り返し生成する
場合に向くと言えます。また内包するコードの大きさという点では
Proc は小規模、Method は大規模コードに向くと言えます。
既存のメソッドを Method オブジェクト化する......。
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo)
p m # => #<Method: Foo#foo>
p m.call(1) # => "foo called with arg 1"
//}
名前のないメソッド(の代わり)が必要なら Proc を使うと良い。
//em... -
Object
# methods(include _ inherited = true) -> [Symbol] (30397.0) -
そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。
...public メソッドおよび protected メソッドの名前を返します。
ただし特別に、引数が偽の時は Object#singleton_methods(false) と同じになっています。
@param include_inherited 引数が偽の時は Object#singleton_methods(false) と同じになります。......ate; def private_parent() end
protected; def protected_parent() end
public; def public_parent() end
end
class Foo < Parent
private; def private_foo() end
protected; def protected_foo() end
public; def public_foo() end
end
obj = Foo.new
class <<obj
private; def p......leton() end
protected; def protected_singleton() end
public; def public_singleton() end
end
# あるオブジェクトの応答できるメソッドの一覧を得る。
p obj.methods(false)
p obj.public_methods(false)
p obj.private_methods(false)
p obj.protected_methods(false)
#... -
Delegator
# methods -> [Symbol] (30307.0) -
そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。
...そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。
このメソッドは public メソッドおよび protected メソッドの名前を返します。
@see Object#methods... -
WIN32OLE
# ole _ func _ methods -> [WIN32OLE _ METHOD] (18460.0) -
オブジェクトのファンクション情報をWIN32OLE_METHODの配列として返し ます。
...32OLE_METHODの配列として返し
ます。
ole_func_methodsメソッドは、OLEオートメーションサーバのメソッドのうちファ
ンクション(何らかの機能的な操作)に属するものをWIN32OLE_METHODの
配列として返します。
@return WIN32OLE_METHODの......excel = WIN32OLE.new('Excel.Application')
excel.visible = true
excel.ole_func_methods.each do |fun|
if fun.name.upcase == 'QUIT'
excel._invoke(fun.dispid, [], [])
break
end
end
@see WIN32OLE#ole_methods, WIN32OLE#ole_get_methods,
WIN32OLE#ole_put_methods... -
WIN32OLE
# ole _ get _ methods -> [WIN32OLE _ METHOD] (18460.0) -
オブジェクトの参照可能プロパティ情報をWIN32OLE_METHODの配列として 返します。
...ティ情報をWIN32OLE_METHODの配列として
返します。
ole_get_methodsメソッドは、OLEオートメーションサーバのメソッドのうち読
み取り可能なプロパティをWIN32OLE_METHODの配列として返します。
@return WIN32OLE_METHODの配列。
@raise WIN32OLE......excel.ole_get_methods.each do |prop|
begin
puts "#{prop.name}=#{excel._getproperty(prop.dispid, [], [])}"
rescue WIN32OLERuntimeError
puts "can't read #{prop.name} property"
end
end
@see WIN32OLE#ole_methods, WIN32OLE#ole_func_methods,
WIN32OLE#ole_put_methods... -
WIN32OLE
# ole _ methods -> [WIN32OLE _ METHOD] (18460.0) -
オブジェクトのメソッド情報をWIN32OLE_METHODの配列として返します。
...クトのメソッド情報をWIN32OLE_METHODの配列として返します。
ole_methodsメソッドは、OLEオートメーションサーバが提供するすべてのメソッ
ドをWIN32OLE_METHODの配列として返します。
@return WIN32OLE_METHODの配列。
@raise WIN32OLERuntimeErro......の呼び出しに失敗しました。
型情報ライブラリ(TypeLib)が提供されていない場合などに発生します。
excel = WIN32OLE.new('Excel.Application')
methods = excel.ole_methods
@see WIN32OLE#ole_func_methods, WIN32OLE#ole_put_methods... -
WIN32OLE
# ole _ put _ methods -> [WIN32OLE _ METHOD] (18460.0) -
オブジェクトの設定可能プロパティ情報をWIN32OLE_METHODの配列として 返します。
...情報をWIN32OLE_METHODの配列として
返します。
ole_put_methodsメソッドは、OLEオートメーションサーバのメソッドのうちプ
ロパティ設定メソッドに属するものをWIN32OLE_METHODの配列として返し
ます。
@return WIN32OLE_METHODの配列。
@rais......た。
型情報ライブラリ(TypeLib)が提供されていない場合などに発生します。
excel = WIN32OLE.new('Excel.Application')
properties = excel.ole_put_methods
@see WIN32OLE#ole_methods, WIN32OLE#ole_func_methods,
WIN32OLE#ole_get_methods... -
WIN32OLE
_ TYPE # ole _ methods -> [WIN32OLE _ METHOD] (18426.0) -
型が持つメソッドのメタデータを取得します。
...2OLE_METHODの配列として返します。
メソッドを持たない場合は空配列を返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
methods = tobj.ole_methods.map {|m| m.name }
# => ['QueryInterface', 'AddRef'......, 'Release',....]
@see WIN32OLE_METHOD... -
Module
# protected _ instance _ methods(inherited _ too = true) -> [Symbol] (18413.0) -
そのモジュールで定義されている protected メソッド名 の一覧を配列で返します。
...そのモジュールで定義されている protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#protected_methods, Module#instance_methods... -
Module
# instance _ methods(inherited _ too = true) -> [Symbol] (18379.0) -
そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。
...ted メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#methods
//emlist[例1][ruby]{
class Foo
private; def private_foo() end
protected; def protected_......foo() end
public; def public_foo() end
end
# あるクラスのインスタンスメソッドの一覧を得る
p Foo.instance_methods(false)
p Foo.public_instance_methods(false)
p Foo.private_instance_methods(false)
p Foo.protected_instance_methods(false)
class Bar < Foo
end
//}
実行......o() end
end
# あるクラスのインスタンスメソッドの一覧を得る。
# 親のクラスのインスタンスメソッドも含めるため true を指定して
# いるが、Object のインスタンスメソッドは一覧から排除している。
p Bar.instance_methods(true)...