別のキーワード
ライブラリ
- ビルトイン (141)
-
cgi
/ core (3) -
cgi
/ html (8) - delegate (4)
- erb (3)
- forwardable (8)
-
irb
/ cmd / help (1) -
irb
/ context (1) -
irb
/ extend-command (1) -
irb
/ input-method (15) -
irb
/ output-method (6) - json (13)
-
net
/ http (2) -
net
/ imap (2) - openssl (10)
- pp (1)
- rake (1)
-
rdoc
/ code _ object (1) -
rdoc
/ context (8) -
rdoc
/ stats (2) -
rdoc
/ top _ level (1) - rubygems (1)
-
webrick
/ cgi (1) -
webrick
/ httprequest (1) -
webrick
/ httpresponse (2) -
webrick
/ httpservlet / abstract (1) - win32ole (41)
クラス
- Array (1)
- BasicObject (6)
- CGI (2)
- Delegator (4)
- ERB (3)
- Enumerator (4)
-
Enumerator
:: Lazy (4) - Exception (1)
-
IRB
:: Context (1) -
IRB
:: ExtendCommand :: Help (1) -
IRB
:: FileInputMethod (2) -
IRB
:: InputMethod (3) -
IRB
:: OutputMethod (5) -
IRB
:: ReadlineInputMethod (5) -
IRB
:: StdioInputMethod (5) -
IRB
:: StdioOutputMethod (1) -
JSON
:: State (2) - Method (24)
- Module (41)
- NameError (2)
-
Net
:: HTTPGenericRequest (1) -
Net
:: IMAP (2) - NoMethodError (2)
- Object (18)
-
OpenSSL
:: Engine (1) -
OpenSSL
:: SSL :: SSLContext (8) -
OpenSSL
:: X509 :: Store (1) - PP (1)
- Proc (6)
-
RDoc
:: CodeObject (1) -
RDoc
:: Context (8) -
RDoc
:: Stats (2) -
RDoc
:: TopLevel (1) - Regexp (2)
-
RubyVM
:: InstructionSequence (6) - String (5)
- Thread (1)
- TracePoint (3)
- UnboundMethod (16)
-
WEBrick
:: CGI (1) -
WEBrick
:: HTTPRequest (1) -
WEBrick
:: HTTPResponse (2) -
WEBrick
:: HTTPServlet :: AbstractServlet (1) - WIN32OLE (11)
-
WIN32OLE
_ EVENT (1) -
WIN32OLE
_ METHOD (18) -
WIN32OLE
_ PARAM (9) -
WIN32OLE
_ TYPE (2)
モジュール
-
CGI
:: HtmlExtension (8) -
CGI
:: QueryExtension (1) - Forwardable (4)
-
Gem
:: QuickLoader (1) -
IRB
:: ExtendCommandBundle (1) -
JSON
:: Generator :: GeneratorMethods :: Array (1) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (1) -
JSON
:: Generator :: GeneratorMethods :: Float (1) -
JSON
:: Generator :: GeneratorMethods :: Hash (1) -
JSON
:: Generator :: GeneratorMethods :: Integer (1) -
JSON
:: Generator :: GeneratorMethods :: NilClass (1) -
JSON
:: Generator :: GeneratorMethods :: Object (1) -
JSON
:: Generator :: GeneratorMethods :: String (3) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (1) -
Net
:: HTTPHeader (1) - SingleForwardable (4)
キーワード
- << (2)
- == (2)
- === (1)
- >> (2)
- [] (3)
-
_ getproperty (1) -
_ invoke (1) -
_ setproperty (1) -
absolute
_ path (1) -
add
_ method (1) -
add
_ response _ handler (2) -
add
_ to (1) -
alias
_ method (1) - args (1)
- arity (2)
- backtrace (1)
-
base
_ label (1) - bind (1)
-
bind
_ call (2) - call (2)
-
callee
_ id (1) -
class
_ exec (1) -
client
_ cert _ cb= (1) - clone (2)
- curry (2)
-
def
_ class (1) -
def
_ delegator (2) -
def
_ delegators (2) -
def
_ instance _ delegator (1) -
def
_ instance _ delegators (1) -
def
_ method (1) -
def
_ module (1) -
def
_ single _ delegator (1) -
def
_ single _ delegators (1) - default (1)
-
default
_ event _ sources (1) -
define
_ method (2) -
define
_ singleton _ method (2) - dig (1)
- dispid (1)
- each (4)
-
each
_ method (1) - encode (3)
- encoding (3)
-
enum
_ for (4) - eof? (2)
- eql? (2)
- event? (1)
-
event
_ interface (1) - execute (1)
-
file
_ name (1) -
find
_ local _ symbol (2) -
find
_ symbol (1) -
first
_ lineno (1) - form (4)
- generate (1)
- gets (4)
- handler= (1)
- hash (2)
- header (1)
- helpcontext (1)
- helpfile (1)
- helpstring (1)
-
initialize
_ methods _ etc (1) - input? (1)
- inspect (2)
-
install
_ alias _ method (1) -
instance
_ eval (2) -
instance
_ method (1) -
instance
_ methods (1) - invkind (1)
-
invoke
_ kind (1) - io (1)
- label (1)
- lambda? (1)
- line (2)
- match (2)
-
method
_ added (1) -
method
_ defined? (1) -
method
_ id (1) -
method
_ list (1) -
method
_ missing (4) -
method
_ removed (1) -
method
_ undefined (1) - methods (2)
-
module
_ exec (1) -
module
_ function (3) -
multipart
_ form (4) - name (5)
-
num
_ methods (1) -
num
_ methods= (1) -
offset
_ vtbl (1) -
ole
_ activex _ initialize (1) -
ole
_ func _ methods (1) -
ole
_ get _ methods (1) -
ole
_ method (1) -
ole
_ method _ help (1) -
ole
_ methods (2) -
ole
_ put _ methods (1) -
ole
_ type (1) -
ole
_ type _ detail (1) - optional? (1)
-
original
_ name (2) - out (1)
- output? (1)
- owner (2)
- parameters (4)
- params (1)
- path (1)
- pp (1)
- ppx (1)
- print (2)
- printn (1)
- private (4)
-
private
_ call? (1) -
private
_ class _ method (2) -
private
_ instance _ methods (1) -
private
_ method _ defined? (1) -
private
_ methods (1) - protected (4)
-
protected
_ instance _ methods (1) -
protected
_ method _ defined? (1) -
protected
_ methods (2) - public (4)
-
public
_ class _ method (2) -
public
_ instance _ method (1) -
public
_ instance _ methods (1) -
public
_ method (1) -
public
_ method _ defined? (1) -
public
_ methods (2) - puts (1)
-
rake
_ extension (1) -
readable
_ atfer _ eof? (3) - receiver (1)
-
remove
_ method (1) -
remove
_ methods _ etc (1) -
renegotiation
_ cb= (1) -
request
_ method (3) -
request
_ method= (1) -
respond
_ to? (1) -
respond
_ to _ missing? (1) -
return
_ type (1) -
return
_ type _ detail (1) -
return
_ vtype (1) - retval? (1)
-
ruby2
_ keywords (2) - send (2)
- seplist (1)
-
servername
_ cb= (1) - service (2)
-
session
_ get _ cb= (1) -
session
_ new _ cb= (1) -
session
_ remove _ cb= (1) -
set
_ default (1) -
set
_ visibility _ for (1) -
singleton
_ method (1) -
singleton
_ method _ added (1) -
singleton
_ method _ removed (1) -
singleton
_ method _ undefined (1) -
singleton
_ methods (1) -
size
_ opt _ params (1) -
size
_ params (1) -
source
_ location (3) -
super
_ method (2) -
tmp
_ dh _ callback= (1) -
to
_ a (1) -
to
_ enum (4) -
to
_ json (9) -
to
_ json _ raw (1) -
to
_ json _ raw _ object (1) -
to
_ proc (1) -
to
_ s (6) -
to
_ str (1) - unbind (1)
-
undef
_ method (1) -
verify
_ callback= (2) - visible? (1)
検索結果
先頭5件
-
UnboundMethod
# owner -> Class | Module (9058.0) -
このメソッドが定義されている class か module を返します。
このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//} -
UnboundMethod
# source _ location -> [String , Integer] | nil (9058.0) -
ソースコードのファイル名と行番号を配列で返します。
ソースコードのファイル名と行番号を配列で返します。
その手続オブジェクトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。
//emlist[例][ruby]{
require 'time'
Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
/... -
UnboundMethod
# to _ s -> String (9058.0) -
self を読みやすい文字列として返します。
self を読みやすい文字列として返します。
詳しくは Method#inspect を参照してください。
//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}
@see Method#inspect -
WIN32OLE
_ METHOD # dispid -> Integer (9058.0) -
メソッドのディスパッチID(DISPID)を取得します。
メソッドのディスパッチID(DISPID)を取得します。
ディスパッチIDはメソッドの一意識別子です。WIN32OLEでは、
WIN32OLE#_invokeなどのメソッドで、呼び出すサーバのメソッドを指定
するのに利用します。
@return メソッドのDISPIDを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.dispid # => 181
... -
WIN32OLE
_ METHOD # event? -> bool (9058.0) -
メソッドがイベントかどうかを取得します。
メソッドがイベントかどうかを取得します。
イベントとはこのサーバが実装しているメソッドではなく、クライアント側が
サーバ側の通知を受けるために実装するメソッドです。
@return メソッドがイベントであれば真。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event? # => true
@see WIN32OLE_EVENT -
WIN32OLE
_ METHOD # event _ interface -> String | nil (9058.0) -
メソッドがイベントの場合、イベントのインターフェイス名を取得します。
メソッドがイベントの場合、イベントのインターフェイス名を取得します。
@return メソッドがイベントであれば、イベントのインターフェイス名を返し
ます。イベントでなければnilを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SheetActivate')
puts method.event_interface # => WorkbookEvents -
WIN32OLE
_ METHOD # helpstring -> String | nil (9058.0) -
メソッドのヘルプ文字列を取得します。
メソッドのヘルプ文字列を取得します。
helpstringは、IDEがメソッドのバルーンヘルプを表示するような場合に利用可
能な、1行程度でメソッドを説明する文字列です。
@return ヘルプ文字列を返します。未定義ならばnilを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
method = WIN32OLE_METHOD.new(tobj, 'Navigate')
puts method.helpstring # => Navigates to a URL o... -
WIN32OLE
_ METHOD # invkind -> Integer (9058.0) -
メソッドの種類を示すINVOKEKIND列挙値を取得します。
メソッドの種類を示すINVOKEKIND列挙値を取得します。
ここで言うメソッドの種類というのは、OLEオートメーションクライアントの記
述言語がどのような形式でサーバ呼び出しを記述すべきかを指定した属性値で
す。
@return メソッドのINVOKEKINDを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.invkind # => 1
INVOKE... -
WIN32OLE
_ METHOD # name -> String (9058.0) -
メソッド名を取得します。
メソッド名を取得します。
@return メソッド名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs -
WIN32OLE
_ METHOD # offset _ vtbl -> Integer (9058.0) -
このメソッドのVTBLのオフセットを取得します。
このメソッドのVTBLのオフセットを取得します。
VTBLはC++やCでメソッドを呼び出すために利用する関数ポインタのテーブルです。
@return メソッドのVTBL上のオフセットを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.offset_vtbl # => 40 -
WIN32OLE
_ METHOD # params -> [WIN32OLE _ PARAM] (9058.0) -
メソッドのパラメータ情報を取得します。
メソッドのパラメータ情報を取得します。
このメソッドのパラメータをWIN32OLE_PARAMの配列として返します。配
列の最初の要素が最左端のパラメータに対応します。
@return WIN32OLE_PARAMの配列。無引数のメソッドであれば要素数0の配
列を返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
p method.params # => ... -
WIN32OLE
_ METHOD # return _ type -> String (9058.0) -
メソッドの返り値の型名を取得します。
メソッドの返り値の型名を取得します。
@return 返り値の型名を示す文字列を返します。
@raise WIN32OLERuntimeError メソッドの型情報を取得できなかった場合に通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
method = WIN32OLE_METHOD.new(tobj, 'Visible')
puts method.return_type # => BOOL
OLEオートメーションの型名は、対応するWIN32OLE... -
WIN32OLE
_ METHOD # return _ vtype -> Integer (9058.0) -
メソッドの返り値の型を示す数値を取得します。
メソッドの返り値の型を示す数値を取得します。
@return 返り値の型を示す数値(VARENUM)を返します。
@raise WIN32OLERuntimeError メソッドの型情報を取得できなかった場合に通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
method = WIN32OLE_METHOD.new(tobj, 'Visible')
puts method.return_vtype # => 11
VARENUMの定義は、Platfo... -
WIN32OLE
_ METHOD # size _ opt _ params -> Integer | nil (9058.0) -
オプションパラメータ数を取得します。
オプションパラメータ数を取得します。
@return オプションパラメータ数を整数で返します。メソッドの詳細情報を取
得できない場合はnilを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.size_opt_params # => 5 -
WIN32OLE
_ METHOD # size _ params -> Integer | nil (9058.0) -
パラメータ数を取得します。
パラメータ数を取得します。
@return パラメータ数を整数で返します。メソッドの詳細情報を取得できない
場合はnilを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.size_params # => 12 -
WIN32OLE
_ METHOD # to _ s -> String (9058.0) -
メソッド名を取得します。
メソッド名を取得します。
@return メソッド名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbook')
method = WIN32OLE_METHOD.new(tobj, 'SaveAs')
puts method.name # => SaveAs -
WIN32OLE
_ METHOD # visible? -> bool (9058.0) -
このメソッドがクライアントに対して公開されているか(可視性を持つか)ど うかを返します。
このメソッドがクライアントに対して公開されているか(可視性を持つか)ど
うかを返します。
@return メソッドが公開されていれば真。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.visible? # => true -
UnboundMethod
# bind _ call(recv , *args) -> object (9040.0) -
self を recv に bind して args を引数として呼び出します。
self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call -
UnboundMethod
# bind _ call(recv , *args) { . . . } -> object (9040.0) -
self を recv に bind して args を引数として呼び出します。
self を recv に bind して args を引数として呼び出します。
self.bind(recv).call(*args) と同じ意味です。
//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}
@see UnboundMethod#bind, Method#call -
UnboundMethod
# hash -> Integer (9040.0) -
自身のハッシュ値を返します。
自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//} -
UnboundMethod
# original _ name -> Symbol (9040.0) -
オリジナルのメソッド名を返します。
オリジナルのメソッド名を返します。
//emlist[例][ruby]{
class C
def foo; end
alias bar foo
end
C.instance_method(:bar).original_name # => :foo
//}
@see Method#original_name -
UnboundMethod
# parameters -> [object] (9040.0) -
UnboundMethod オブジェクトの引数の情報を返します。
UnboundMethod オブジェクトの引数の情報を返します。
詳しくは Method#parameters を参照してください。
@see Proc#parameters, Method#parameters -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (9022.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby... -
NoMethodError
# args -> [object] (9022.0) -
メソッド呼び出しに使われた引数を配列で返します。
メソッド呼び出しに使われた引数を配列で返します。
例:
begin
foobar(1,2,3)
rescue NoMethodError
p $!
p $!.name
p $!.args
end
# => #<NoMethodError: undefined method `foobar' for main:Object>
:foobar
[1, 2, 3] -
UnboundMethod
# name -> Symbol (9022.0) -
このメソッドの名前を返します。
このメソッドの名前を返します。
//emlist[例][ruby]{
a = String.instance_method(:size)
a.name # => :size
//} -
IRB
:: FileInputMethod # encoding -> Encoding (9004.0) -
読み込んだファイルの文字エンコーディングを返します。
読み込んだファイルの文字エンコーディングを返します。 -
IRB
:: FileInputMethod # gets -> String (9004.0) -
読み込んだファイルから文字列を 1 行読み込みます。
読み込んだファイルから文字列を 1 行読み込みます。 -
IRB
:: InputMethod # file _ name -> String (9004.0) -
ファイル名を文字列で返します。
ファイル名を文字列で返します。 -
IRB
:: InputMethod # gets (9004.0) -
NotImplementedError が発生します。
NotImplementedError が発生します。
@raise NotImplementedError 必ず発生します。 -
IRB
:: InputMethod # readable _ atfer _ eof? -> false (9004.0) -
入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。
入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。 -
IRB
:: OutputMethod # pp(*objs) -> object (9004.0) -
各 obj を inspect した文字列を self に出力し、最後に改行を出力します。
各 obj を inspect した文字列を self に出力し、最後に改行を出力します。
@param objs 任意のオブジェクトを指定します。 -
IRB
:: OutputMethod # ppx(prefix , *objs) -> object (9004.0) -
引数 prefix + 各 obj を inspect した文字列を self に出力し、最後に改行 を出力します。
引数 prefix + 各 obj を inspect した文字列を self に出力し、最後に改行
を出力します。
@param prefix 各 obj の先頭に追記する文字列を指定します。
@param objs 任意のオブジェクトを指定します。 -
IRB
:: OutputMethod # print(*objs) (9004.0) -
NotImplementedError が発生します。
NotImplementedError が発生します。
@param objs 任意のオブジェクトを指定します。
@raise NotImplementedError 必ず発生します。 -
IRB
:: OutputMethod # printn(*objs) -> nil (9004.0) -
各 obj を self に出力し、最後に改行を出力します。
各 obj を self に出力し、最後に改行を出力します。
@param objs 任意のオブジェクトを指定します。 -
IRB
:: OutputMethod # puts(*objs) -> object (9004.0) -
各 obj を self に出力し、それぞれの後に改行を出力します。
各 obj を self に出力し、それぞれの後に改行を出力します。
@param objs 任意のオブジェクトを指定します。 -
IRB
:: ReadlineInputMethod # encoding -> Encoding (9004.0) -
自身の文字エンコーディングを返します。
自身の文字エンコーディングを返します。 -
IRB
:: ReadlineInputMethod # eof? -> bool (9004.0) -
入力が EOF(End Of File)に達したかどうかを返します。
入力が EOF(End Of File)に達したかどうかを返します。 -
IRB
:: ReadlineInputMethod # gets -> String (9004.0) -
標準入力から文字列を 1 行読み込みます。
標準入力から文字列を 1 行読み込みます。 -
IRB
:: ReadlineInputMethod # line(line _ no) -> String (9004.0) -
引数 line_no で指定した過去の入力を行単位で返します。
引数 line_no で指定した過去の入力を行単位で返します。
@param line_no 取得する行番号を整数で指定します。 -
IRB
:: ReadlineInputMethod # readable _ atfer _ eof? -> false (9004.0) -
入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。
入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。 -
IRB
:: StdioInputMethod # encoding -> Encoding (9004.0) -
自身の文字エンコーディングを返します。
自身の文字エンコーディングを返します。 -
IRB
:: StdioInputMethod # eof? -> bool (9004.0) -
入力が EOF(End Of File)に達したかどうかを返します。
入力が EOF(End Of File)に達したかどうかを返します。 -
IRB
:: StdioInputMethod # gets -> String (9004.0) -
標準入力から文字列を 1 行読み込みます。
標準入力から文字列を 1 行読み込みます。 -
IRB
:: StdioInputMethod # line(line _ no) -> String (9004.0) -
引数 line_no で指定した過去の入力を行単位で返します。
引数 line_no で指定した過去の入力を行単位で返します。
@param line_no 取得する行番号を整数で指定します。 -
IRB
:: StdioInputMethod # readable _ atfer _ eof? -> true (9004.0) -
入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。
入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。 -
IRB
:: StdioOutputMethod # print(*objs) -> nil (9004.0) -
引数を標準出力に出力します。
引数を標準出力に出力します。
@param objs 任意のオブジェクトを指定します。 -
JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
[1, 2, 3].to_json # => "[1,2,3]"
//} -
JSON
:: Generator :: GeneratorMethods :: FalseClass # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"false" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
false.to_json # => "false"
//} -
JSON
:: Generator :: GeneratorMethods :: Float # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
(1.0).to_json # => "1.0"
//} -
JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
person = { "name" => "tanaka", "age" => 19 }
person.to_json # ... -
JSON
:: Generator :: GeneratorMethods :: Integer # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
10.to_json # => "10"
//} -
JSON
:: Generator :: GeneratorMethods :: NilClass # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"null" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
nil.to_json # => "null"
//} -
JSON
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw -> String (9004.0) -
自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
@see JSON::Generator::GeneratorMethods::String#to_json_raw_object, JSON::Generator::GeneratorMethods::Hash#to_json -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw _ object -> Hash (9004.0) -
生の文字列を格納したハッシュを生成します。
生の文字列を格納したハッシュを生成します。
このメソッドは UTF-8 の文字列ではなく生の文字列を JSON に変換する場合に使用してください。
require 'json'
"にほんご".encode("euc-jp").to_json_raw_object
# => {"json_class"=>"String", "raw"=>[164, 203, 164, 219, 164, 243, 164, 180]}
"にほんご".encode("euc-jp").to_json # source sequence is illegal/malformed (JSON::... -
JSON
:: Generator :: GeneratorMethods :: TrueClass # to _ json(state _ or _ hash = nil) -> String (9004.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"true" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//} -
NoMethodError
# private _ call? -> bool (9004.0) -
メソッド呼び出しが private なメソッドを呼び出せる形式 (関数形式(レシーバを省略した形式)) で呼ばれたかどうかを返します。
メソッド呼び出しが private なメソッドを呼び出せる形式
(関数形式(レシーバを省略した形式)) で呼ばれたかどうかを返します。 -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (733.0) -
For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.
For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument... -
Forwardable
# def _ delegator(accessor , method , ali = method) -> () (652.0) -
メソッドの委譲先を設定します。
メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
exten... -
Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () (652.0) -
メソッドの委譲先を設定します。
メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
exten... -
SingleForwardable
# def _ delegator(accessor , method , ali = method) -> () (652.0) -
メソッドの委譲先を設定します。
メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略することが可能です。
def_delegator は def_singleton_delegator の別名になります。
@see SingleForwardable#def_delegators -
SingleForwardable
# def _ single _ delegator(accessor , method , ali = method) -> () (652.0) -
メソッドの委譲先を設定します。
メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略することが可能です。
def_delegator は def_singleton_delegator の別名になります。
@see SingleForwardable#def_delegators -
Object
# enum _ for(method = :each , *args) -> Enumerator (418.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (418.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# to _ enum(method = :each , *args) -> Enumerator (418.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (418.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
CGI
:: HtmlExtension # form(method = "post" , action = nil , enctype = "application / x-www-form-urlencoded") -> String (406.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
form 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。
@param method method 属性の値として "get" か "post" を指定します。
@param action action 属性の値を指定します。デフォルトは現在の CGI スクリプト名です。
@param enctype enctype 属性の値を指定します。デフォルトは "application/x-www-form-urlencoded" です。
例:
form{ "string" }
# <FORM METHOD="post" ENCTYPE="app... -
CGI
:: HtmlExtension # form(method = "post" , action = nil , enctype = "application / x-www-form-urlencoded") { . . . } -> String (406.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
form 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。
@param method method 属性の値として "get" か "post" を指定します。
@param action action 属性の値を指定します。デフォルトは現在の CGI スクリプト名です。
@param enctype enctype 属性の値を指定します。デフォルトは "application/x-www-form-urlencoded" です。
例:
form{ "string" }
# <FORM METHOD="post" ENCTYPE="app... -
RDoc
:: Context # find _ symbol(symbol , method=nil) (403.0) -
Look up the given symbol. If method is non-nil, then we assume the symbol references a module that contains that method
Look up the given symbol. If method is non-nil, then we assume
the symbol references a module that contains that method -
PP
# seplist(list , sep = lambda { comma _ breakable } , iter _ method = :each) {|e| . . . } -> () (361.0) -
リストの各要素を何かで区切りつつ、自身に追加していくために使われます。
リストの各要素を何かで区切りつつ、自身に追加していくために使われます。
list を iter_method によってイテレートし、各要素を引数としてブロックを実行します。
また、それぞれのブロックの実行の合間に sep が呼ばれます。
つまり、以下のふたつは同値です。
//emlist[][ruby]{
q.seplist([1,2,3]) {|v| q.pp v }
q.pp 1
q.comma_breakable
q.pp 2
q.comma_breakable
q.pp 3
//}
@param list 自身に追加したい配列を与えます。iter_method を適切に指定... -
Module
# rake _ extension(method) { . . . } -> () (325.0) -
与えられたブロック内で既に存在するメソッドを再定義しようとした場合に 警告を表示します。この場合、ブロックは評価されません。
与えられたブロック内で既に存在するメソッドを再定義しようとした場合に
警告を表示します。この場合、ブロックは評価されません。
@param method ブロック内で再定義する予定のメソッド名を指定します。
例:
class String
rake_extension("xyz") do
def xyz
...
end
end
end -
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (316.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (316.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy (316.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (316.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (304.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
@param 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 = ERB.n... -
ERB
# def _ module(methodname=& # 39;erb& # 39;) -> Module (304.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
@param methodname メソッド名
//emlist[例][ruby]{
require 'erb'
filename = 'example.rhtml'
erb = ERB.new("test1<%= arg1 %>\ntest2<%= arg2 %>\n")
erb.filename = filename
MyModule = erb.def_module('render(arg1, arg2)')
class MyClass
include MyModule
end
print My... -
Forwardable
# def _ delegators(accessor , *methods) -> () (304.0) -
メソッドの委譲先をまとめて設定します。
メソッドの委譲先をまとめて設定します。
@param accessor 委譲先のオブジェクト
@param methods 委譲するメソッドのリスト
委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。
def_delegators は def_instance_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@reco... -
Forwardable
# def _ instance _ delegators(accessor , *methods) -> () (304.0) -
メソッドの委譲先をまとめて設定します。
メソッドの委譲先をまとめて設定します。
@param accessor 委譲先のオブジェクト
@param methods 委譲するメソッドのリスト
委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。
def_delegators は def_instance_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@reco... -
IRB
:: Context # io -> IRB :: InputMethod (304.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。 -
RDoc
:: Context # set _ visibility _ for(methods , visibility , singleton = false) -> () (304.0) -
methods で指定した RDoc::AnyMethod、RDoc::Attr の内、 singleton で指定した条件と一致するメソッドすべての可視性を visibility に設定します。
methods で指定した RDoc::AnyMethod、RDoc::Attr の内、
singleton で指定した条件と一致するメソッドすべての可視性を visibility
に設定します。
@param methods RDoc::AnyMethod、RDoc::Attr オブジェクトの配
列を指定します。
@param visibility 可視性を :public, :protected, :private の内のいずれか
で指定します。
@param singleton 特異メソッドの可視性を変更する場合は... -
RDoc
:: TopLevel # find _ local _ symbol(name) -> RDoc :: NormalClass | RDoc :: SingleClass | RDoc :: NormalModule | RDoc :: AnyMethod | RDoc :: Alias | RDoc :: Attr | RDoc :: Constant (304.0) -
クラス、モジュール、メソッド、定数、属性、alias、ファイルから name で指定したものを返します。見つからなかった場合は nil を返します。
クラス、モジュール、メソッド、定数、属性、alias、ファイルから name で指定したものを返します。見つからなかった場合は nil を返します。 -
SingleForwardable
# def _ delegators(accessor , *methods) -> () (304.0) -
メソッドの委譲先をまとめて設定します。
メソッドの委譲先をまとめて設定します。
@param accessor 委譲先のオブジェクト
@param methods 委譲するメソッドのリスト
委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。
def_delegators は def_singleton_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@rec... -
SingleForwardable
# def _ single _ delegators(accessor , *methods) -> () (304.0) -
メソッドの委譲先をまとめて設定します。
メソッドの委譲先をまとめて設定します。
@param accessor 委譲先のオブジェクト
@param methods 委譲するメソッドのリスト
委譲元のオブジェクトで methods のそれぞれのメソッドが呼び出された場合に、
委譲先のオブジェクトの同名のメソッドへ処理が委譲されるようになります。
def_delegators は def_singleton_delegators の別名になります。
また、以下の 2 つの例は同じ意味です。
def_delegators :@records, :size, :<<, :map
def_delegator :@rec... -
Proc
# ruby2 _ keywords -> proc (172.0) -
Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.
Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked ... -
Object
# respond _ to?(name , include _ all = false) -> bool (148.0) -
オブジェクトがメソッド name を持つとき真を返します。
オブジェクトがメソッド name を持つとき真を返します。
オブジェクトが メソッド name を持つというのは、
オブジェクトが メソッド name に応答できることをいいます。
Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブラリなど、C言語で実装されているメソッドのみです。
Rubyで実装されたメソッドで N... -
OpenSSL
:: Engine # set _ default(flags) -> true (148.0) -
engine をデフォルトで利用するようにします。
engine をデフォルトで利用するようにします。
flags は engine を openssl のどの機能に関してデフォルトに
するかを指定します。
flags は以下の値の OR を取ります。
* OpenSSL::Engine::METHOD_CIPHERS
* OpenSSL::Engine::METHOD_DH
* OpenSSL::Engine::METHOD_DIGESTS
* OpenSSL::Engine::METHOD_DSA
* OpenSSL::Engine::METHOD_RSA
* OpenSSL::Engine::METHOD_RA... -
Proc
# lambda? -> bool (130.0) -
手続きオブジェクトの引数の取扱が厳密であるならば true を返します。
手続きオブジェクトの引数の取扱が厳密であるならば true を返します。
引数の取扱の厳密さの意味は以下の例を参考にしてください。
//emlist[例][ruby]{
# lambda で生成した Proc オブジェクトでは true
lambda{}.lambda? # => true
# proc で生成した Proc オブジェクトでは false
proc{}.lambda? # => false
# Proc.new で生成した Proc オブジェクトでは false
Proc.new{}.lambda? # => false
# 以下、lambda?が偽である場合
#... -
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (124.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
自身が symbol で表されるメソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。
Object#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。
BasicObject#method_missing を override した場合にこのメソッドも
override されるべきです。
false を返します。
@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます... -
TracePoint
# callee _ id -> Symbol | nil (94.0) -
イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。
イベントが発生したメソッドの呼ばれた名前を Symbol で返します。
トップレベルであった場合は nil を返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end
trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
e... -
Proc
# <<(callable) -> Proc (76.0) -
self と引数を合成した Proc を返します。
self と引数を合成した Proc を返します。
戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を callable に渡して呼び出し、
その戻り値を self に渡して呼び出した結果を返します。
Proc#>> とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }
# (3 + 3) * (3 + ... -
Proc
# >>(callable) -> Proc (76.0) -
self と引数を合成した Proc を返します。
self と引数を合成した Proc を返します。
戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を self に渡して呼び出し、
その戻り値を callable に渡して呼び出した結果を返します。
Proc#<< とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }
# (3 * 3) + (3 * ... -
RubyVM
:: InstructionSequence # base _ label -> String (76.0) -
self が表す命令シーケンスの基本ラベルを返します。
self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "h... -
RubyVM
:: InstructionSequence # label -> String (76.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: R... -
TracePoint
# parameters -> [object] (70.0) -
現在のフックが属するメソッドまたはブロックのパラメータ定義を返します。 フォーマットは Method#parameters と同じです。
現在のフックが属するメソッドまたはブロックのパラメータ定義を返します。
フォーマットは Method#parameters と同じです。
@raise RuntimeError :call、:return、:b_call、:b_return、:c_call、:c_return
イベントのためのイベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(a, b = 2)
end
TracePoint.new(:call) do |tp|
p tp.parameters # => a], [:opt, ... -
CGI
:: HtmlExtension # form(attributes) -> String (61.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
form 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。
@param attributes 属性をハッシュで指定します。
例:
form({"METHOD" => "post", ENCTYPE => "enctype"}){ "string" }
# <FORM METHOD="post" ENCTYPE="enctype">string</FORM>
@see CGI::HtmlExtension#multipart_form -
CGI
:: HtmlExtension # form(attributes) { . . . } -> String (61.0) -
form 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。
form 要素を生成します。
ブロックを与えると、ブロックを評価した結果が内容になります。
@param attributes 属性をハッシュで指定します。
例:
form({"METHOD" => "post", ENCTYPE => "enctype"}){ "string" }
# <FORM METHOD="post" ENCTYPE="enctype">string</FORM>
@see CGI::HtmlExtension#multipart_form -
CGI
# header(options = "text / html") -> String (58.0) -
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。 CGI#out を使わずに自力で HTML を出力したい場合などに使います。 このメソッドは文字列エンコーディングを変換しません。
HTTP ヘッダを options に従って生成します。 CGI#out と違い、標準出力には出力しません。
CGI#out を使わずに自力で HTML を出力したい場合などに使います。
このメソッドは文字列エンコーディングを変換しません。
ヘッダのキーとしては以下が利用可能です。
: type
Content-Type ヘッダです。デフォルトは "text/html" です。
: charset
ボディのキャラクタセットを Content-Type ヘッダに追加します。
: nph
真偽値を指定します。真ならば、HTTP のバージョン、ステータスコード、
Date ヘッ... -
Enumerator
# each -> self (58.0) -
生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。
生成時のパラメータに従ってブロックを繰り返します。
*args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。
ブロック付きで呼び出された場合は、
生成時に指定したイテレータの戻り値をそのまま返します。
@param args 末尾へ追加する引数
//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"
enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } ... -
Enumerator
# each { . . . } -> object (58.0) -
生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。
生成時のパラメータに従ってブロックを繰り返します。
*args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。
ブロック付きで呼び出された場合は、
生成時に指定したイテレータの戻り値をそのまま返します。
@param args 末尾へ追加する引数
//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"
enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } ...