種類
- インスタンスメソッド (54)
- 文書 (36)
- 定数 (12)
- 関数 (12)
- クラス (12)
ライブラリ
- ビルトイン (42)
-
rdoc
/ markup (24)
クラス
- Module (24)
- Proc (6)
-
RDoc
:: Markup (12) -
RDoc
:: Options (12) - Thread (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Markup (12)
-
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (5) -
add
_ special (12) - refine (12)
-
ruby2
_ keywords (18) -
special
_ local _ set (12) -
thread
_ variable _ get (12) - クラス/メソッドの定義 (12)
検索結果
先頭5件
-
RDoc
:: Options :: SPECIAL -> [String] (21101.0) -
--write-options を指定した際に .rdoc_options ファイルに保存されないオプ ションの一覧を返します。
...--write-options を指定した際に .rdoc_options ファイルに保存されないオプ
ションの一覧を返します。... -
RDoc
:: Markup # add _ special(pattern , name) -> () (12231.0) -
pattern で指定した正規表現にマッチする文字列をフォーマットの対象にしま す。
...定した正規表現にマッチする文字列をフォーマットの対象にしま
す。
例えば WikiWord のような、SM::SimpleMarkup#add_word_pair、
SM::SimpleMarkup#add_html でフォーマットできないものに対して使用
します。
@param pattern 正規表現を指定......re 'rdoc/markup/simple_markup'
require 'rdoc/markup/simple_markup/to_html'
class WikiHtml < SM::ToHtml
def handle_special_WIKIWORD(special)
"<font color=red>" + special.text + "</font>"
end
end
m = SM::SimpleMarkup.new
m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)......h = WikiHtml.new
puts m.convert(input_string, h)
変換時に実際にフォーマットを行うには SM::ToHtml#accept_special_<name で指定した名前>
のように、フォーマッタ側でも操作を行う必要があります。... -
static void special
_ local _ set(char c , VALUE val) (6200.0) -
$~ と $_ をセットします。 現在は c=0 が $_ で c=1 が $~ です。
$~ と $_ をセットします。
現在は c=0 が $_ で c=1 が $~ です。 -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (6116.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.
...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, th......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
o......ther methods.
This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions... -
Proc
# ruby2 _ keywords -> proc (6116.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.
...ing 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 suc......r 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.
This should only be used for procs that delegate keywords to another
method, and only......wards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this method i... -
Thread
# thread _ variable _ get(key) -> object | nil (6106.0) -
引数 key で指定した名前のスレッドローカル変数を返します。
...意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、Fiber を切り替えても同じ変数を返す事に注意してください。
例:
Thread.new {
Thread.current.thread_variable_set("foo", "bar") # スレッドローカル
Thread.current["f......Fiber.new {
Fiber.yield [
Thread.current.thread_variable_get("foo"), # スレッドローカル
Thread.current["foo"], # Fiber ローカル
]
}.resume
}.join.value # => ['bar', nil]
この例の "bar" は Thread#thread_variable_get により得......られ
た値で、nil はThread#[] により得られた値です。
@see Thread#thread_variable_set, Thread#[]
@see https://magazine.rubyist.net/articles/0041/0041-200Special-note.html... -
クラス/メソッドの定義 (3108.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...odule
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined
===[a:class] クラス定義
//emlist[例][ruby]{
class Foo < Super
def test
# ...
end
# ...
end......ss ]
式..
end
文法:
class 識別子 [`<' superclass ]
式..
[rescue [error_type,..] [=> evar] [then]
式..]..
[else
式..]
[ensure
式..]
end
クラスを定義します。......を指定できます。
例外処理についてはd:spec/control#begin参照。
メソッド定義式は、メソッド名を Symbol にしたオブジェクトを返します。
@see https://magazine.rubyist.net/articles/0041/0041-200Special-kwarg.html
====[a:operator] 演算子式の定義
s... -
Module
# refine(klass) { . . . } -> Module (3106.0) -
引数 klass で指定したクラスまたはモジュールだけに対して、ブロックで指定した機能を提供で きるモジュールを定義します。定義した機能は Module#refine を使用せずに直 接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。 そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。
...モジュールだけに対して、ブロックで指定した機能を提供で
きるモジュールを定義します。定義した機能は Module#refine を使用せずに直
接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。
そのた......参照してください。
* https://magazine.rubyist.net/articles/0041/0041-200Special-refinement.html
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html
定義した機能は main.using, Module#using を実行した場合のみ
有効になります。
@param klass 拡張す......した機能を持つ無名のモジュールを返します。
//emlist[例][ruby]{
class C
def foo
puts "C#foo"
end
end
module M
refine C do
def foo
puts "C#foo in M"
end
end
end
x = C.new
x.foo # => "C#foo"
using M
x = C.new
x.foo # => "C#foo in M"
//}
@see main.us... -
RDoc
:: Markup (3024.0) -
RDoc 形式のドキュメントを目的の形式に変換するためのクラスです。
...RDoc 形式のドキュメントを目的の形式に変換するためのクラスです。
例:
require 'rdoc/markup/to_html'
h = RDoc::Markup::ToHtml.new
puts h.convert(input_string)
独自のフォーマットを行うようにパーサを拡張する事もできます。
例:
req......uire 'rdoc/markup'
require 'rdoc/markup/to_html'
class WikiHtml < RDoc::Markup::ToHtml
# WikiWord のフォントを赤く表示。
def handle_special_WIKIWORD(special)
"<font color=red>" + special.text + "</font>"
end
end
m = RDoc::Markup.new
# { 〜 } までを :STRIK......E でフォーマットする。
m.add_word_pair("{", "}", :STRIKE)
# <no> 〜 </no> までを :STRIKE でフォーマットする。
m.add_html("no", :STRIKE)
# WikiWord を追加。
m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
wh = WikiHtml.new(m)
# :STRIKE のフォーマ...