903件ヒット
[101-200件を表示]
(0.303秒)
ライブラリ
- ビルトイン (636)
- erb (36)
-
irb
/ cmd / help (12) -
irb
/ input-method (12) - json (36)
-
minitest
/ spec (1) -
minitest
/ unit (2) - openssl (12)
-
rdoc
/ top _ level (12) - win32ole (144)
クラス
- BasicObject (60)
- ERB (36)
-
IRB
:: ExtendCommand :: Help (12) -
IRB
:: InputMethod (12) -
JSON
:: State (12) - Method (24)
-
MiniTest
:: Unit (1) - Module (360)
- NameError (12)
- NoMethodError (12)
- Object (109)
-
OpenSSL
:: SSL :: SSLContext (12) -
RDoc
:: TopLevel (12) - Thread (12)
- TracePoint (24)
- UnboundMethod (24)
- WIN32OLE (24)
-
WIN32OLE
_ METHOD (24) -
WIN32OLE
_ PARAM (72) -
WIN32OLE
_ TYPE (24)
モジュール
キーワード
- [] (24)
- args (12)
-
assert
_ respond _ to (1) -
callee
_ id (12) -
def
_ class (12) -
def
_ method (12) -
def
_ module (12) - default (12)
-
default
_ event _ sources (12) -
define
_ method (24) -
define
_ singleton _ method (24) - execute (12)
-
file
_ name (12) -
find
_ local _ symbol (12) -
instance
_ eval (12) -
instance
_ method (12) -
method
_ added (12) -
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) -
method
_ removed (12) -
method
_ undefined (12) -
module
_ function (36) -
must
_ respond _ to (1) -
ole
_ func _ methods (12) -
ole
_ get _ methods (12) -
ole
_ methods (12) - optional? (12)
-
original
_ name (24) - output? (12)
- private (48)
-
private
_ class _ method (24) -
private
_ method _ defined? (12) - protected (48)
-
protected
_ method _ defined? (12) - public (12)
-
public
_ class _ method (24) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) - puke (1)
-
remove
_ method (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - retval? (12)
-
ruby2
_ keywords (12) - send (24)
-
servername
_ cb= (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
to
_ json (24) -
to
_ s (36) -
undef
_ method (12)
検索結果
先頭5件
-
JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String (15113.0) -
自身から生成した JSON 形式の文字列を返します。
...ます。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
requir......e "json"
person = { "name" => "tanaka", "age" => 19 }
person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"
//}... -
ERB
# def _ method(mod , methodname , fname=& # 39;(ERB)& # 39;) -> nil (12608.0) -
変換した Ruby スクリプトをメソッドとして定義します。
...ソッド名は methodname で指定します。
fname はスクリプトを定義する際のファイル名です。主にエラー時に活躍します。
@param mod メソッドを定義するモジュール(またはクラス)
@param methodname メソッド名
@param fname スクリプ......トを定義する際のファイル名
例:
require 'erb'
erb = ERB.new(script)
erb.def_method(MyClass, 'foo(bar)', 'foo.erb')... -
Object
# public _ method(name) -> Method (12578.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...ublic メソッド name をオブジェクト化した
Method オブジェクトを返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名......を引数として与えると発生します。
//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method `p' for class `Integer' is private (NameError)
//}
@see Object#method,Object#public_send,Module#public_instance_method... -
Module
# define _ method(name , method) -> Symbol (12558.0) -
インスタンスメソッド name を定義します。
... name を定義します。
ブロックを与えた場合、定義したメソッドの実行時にブロックが
レシーバクラスのインスタンスの上で BasicObject#instance_eval されます。
@param name メソッド名を String または Symbol を指定します。
@param met......hod Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
@raise TypeError method に同じクラス、サブクラス、モジュール以外のメソッ
ドを指定......した場合に発生します。
//emlist[例][ruby]{
class Foo
def foo() p :foo end
define_method(:bar, instance_method(:foo))
end
Foo.new.bar # => :foo
//}... -
Module
# method _ defined?(name , inherit=true) -> bool (12493.0) -
モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。
...モジュールにインスタンスメソッド name が定義されており、
かつその可視性が public または protected であるときに
true を返します。
@param name Symbol か String を指定します。
@param inherit 真を指定するとスーパークラスや include......e#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined?
//emlist[例][ruby]{
module A
def method1() end
def protected_method1() end
protected :protected_method1
end
class B
def method2() end
def private_method2() end
private :private_method2
end
cl......def method3() end
end
A.method_defined? :method1 #=> true
C.method_defined? "method1" #=> true
C.method_defined? "method2" #=> true
C.method_defined? "method2", true #=> true
C.method_defined? "method2", false #=> false
C.method_defined? "method3"... -
Object
# singleton _ method(name) -> Method (12478.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
...異メソッド name をオブジェクト化した Method オブ
ジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
clas......emo
def initialize(n)
@iv = n
end
def hello()
"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#send, Kernel.#eval, Object#method... -
Module
# instance _ method(name) -> UnboundMethod (12461.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...ド name をオブジェクト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
/....../emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; end
def do_d() print "Hello "; end
def do_e() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),......"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!
//}... -
Module
# public _ instance _ method(name) -> UnboundMethod (12455.0) -
self の public インスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...タンスメソッド name をオブジェクト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名を引......として与えると発生します。
//emlist[例][ruby]{
Kernel.public_instance_method(:object_id) #=> #<UnboundMethod: Kernel#object_id>
Kernel.public_instance_method(:p) # method `p' for module `Kernel' is private (NameError)
//}
@see Module#instance_method,Object#public_method... -
WIN32OLE
# ole _ func _ methods -> [WIN32OLE _ METHOD] (12436.0) -
オブジェクトのファンクション情報をWIN32OLE_METHODの配列として返し ます。
...32OLE_METHODの配列として返し
ます。
ole_func_methodsメソッドは、OLEオートメーションサーバのメソッドのうちファ
ンクション(何らかの機能的な操作)に属するものをWIN32OLE_METHODの
配列として返します。
@return WIN32OLE_METHODの......ntimeError オートメーションサーバの呼び出しに失敗しました。
型情報ライブラリ(TypeLib)が提供されていない場合などに発生します。
excel = WIN32OLE.new('Excel.Application')
excel.visible = true
excel.ole_func_method......s.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...