ライブラリ
- ビルトイン (79)
- fiddle (11)
- logger (33)
-
minitest
/ unit (1) - open-uri (2)
- profiler (6)
-
syslog
/ logger (22)
クラス
- BasicObject (11)
-
Fiddle
:: Function (11) - Logger (22)
-
Logger
:: Formatter (11) - Module (16)
- Object (22)
-
Syslog
:: Logger (11) -
Syslog
:: Logger :: Formatter (11) - TracePoint (22)
モジュール
- Kernel (2)
-
MiniTest
:: Assertions (1) -
RubyVM
:: AbstractSyntaxTree (8)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
Profiler
_ _ (6) -
assert
_ respond _ to (1) -
callee
_ id (11) - formatter (11)
- formatter= (22)
-
instance
_ eval (11) -
instance
_ method (11) - method (11)
-
method
_ id (11) - new (11)
- open (2)
-
parse
_ file (8) - profile (6)
-
rb
_ funcall (11) -
rb
_ funcall2 (11) -
rb
_ funcall3 (11) - rdoc (11)
-
rdoc
/ parser / c (11) -
rexml
/ parsers / sax2parser (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
ruby2
_ keywords (5) -
singleton
_ method (11) - クラス/メソッドの定義 (11)
- 正規表現 (11)
検索結果
先頭5件
-
Logger
:: Formatter # call(severity , time , progname , msg) -> String (18201.0) -
ログ情報をフォーマットして返します。
...ログ情報をフォーマットして返します。
@param severity ログレベル。
@param time 時間。Time クラスのオブジェクト。
@param progname プログラム名
@param msg メッセージ。... -
Syslog
:: Logger :: Formatter # call(severity , time , progname , message) -> String (18201.0) -
引数を元にフォーマットした文字列を返します。
引数を元にフォーマットした文字列を返します。
ライブラリ内部で使用します。 -
VALUE rb
_ funcall(VALUE recv , ID name , int nargs , . . . ) (6216.0) -
recv に対してメソッド name を呼びだし、 メソッドの返り値を返します。プライベートメソッドも 呼びだせます。
...recv に対してメソッド name を呼びだし、
メソッドの返り値を返します。プライベートメソッドも
呼びだせます。
メソッドへの引数は第四引数以降にあたえ、その数を nargs
に指定します。それら引数はすべて VALUE でなけれ... -
VALUE rb
_ funcall2(VALUE recv , ID name , int nargs , VALUE *args) (6216.0) -
recv に対してメソッド name を呼びだし、 メソッドの返り値を返します。プライベートメソッドも 呼びだせます。
...recv に対してメソッド name を呼びだし、
メソッドの返り値を返します。プライベートメソッドも
呼びだせます。
メソッドへの引数は VALUE の配列として第四引数にあたえ、
その長さを nargs に指定します。... -
TracePoint
# callee _ id -> Symbol | nil (6142.0) -
イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。
...した場合に発生します。
//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]
end
trace.enable do
C.new.alias_name
end
//}
@see TracePoint#method_id... -
VALUE rb
_ funcall3(VALUE recv , ID mid , int argc , const VALUE *argv) (6116.0) -
recv に対してメソッド name を呼びだし、 メソッドの返り値を返します。
...recv に対してメソッド name を呼びだし、
メソッドの返り値を返します。
メソッドへの引数は VALUE の配列として第四引数にあたえ、
その長さを nargs に指定します。
rb_funcall2 との違いは、プライベートメソッドを呼び出せ... -
正規表現 (234.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...ティ(属性情報)による文字クラス指定も可能です。
以下の記法が使えます。
* \p{property-name}
* \p{^property-name} (否定)
* \P{property-name} (否定)
サポートされているプロパティのリストは
https://github.com/k-takata/Onigmo/blob/master/doc/Uni......キストは MatchData#[] で参照できる
m[1] # => "at"
//}
1,2,... ではなく、名前を付けることができます。
(?<name>pat)もしくは(?'name'pat)と記述します。キャプチャした文字列は
MatchData#[] に Symbol を渡すことで参照できます。
これは名......==[a:subexp] 部分式呼び出し(subexpression call)
\g<name> もしくは \g'name'
という記法で、nameと名付けられた部分正規表現にマッチしようとします。
この記法は、部分式呼び出しと呼ばれます。
name には名前、数字、のいずれを用い... -
Kernel
. # open(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO | Tempfile | IO (166.0) -
name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
...
name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
name......て渡し
name.open(*rest, &block) のように name の open メソッドが呼ばれます。
これ以外の場合は、name はファイル名として扱われ、従来の
Kernel.#open(name, *rest) が呼ばれます。
ブロックを与えた場合は上の場合と同様、name が http://......た。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
@param name オープンしたいリソースを文字列で与えます。
@param mode モードを文字列で... -
Kernel
. # open(name , mode = & # 39;r& # 39; , perm = nil , options = {}) {|ouri| . . . } -> object (166.0) -
name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
...
name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
name......て渡し
name.open(*rest, &block) のように name の open メソッドが呼ばれます。
これ以外の場合は、name はファイル名として扱われ、従来の
Kernel.#open(name, *rest) が呼ばれます。
ブロックを与えた場合は上の場合と同様、name が http://......た。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
@param name オープンしたいリソースを文字列で与えます。
@param mode モードを文字列で... -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (133.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......, 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 p......s it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.
//emlist[... -
Module
# instance _ method(name) -> UnboundMethod (129.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#publ......d(: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!
//}... -
Object
# method(name) -> Method (129.0) -
オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。
...オブジェクトのメソッド name をオブジェクト化した
Method オブジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//em......list[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#abs>
p me.call #=> 365
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method...