種類
- インスタンスメソッド (93)
- 文書 (24)
- モジュール (11)
- 特異メソッド (11)
ライブラリ
- ビルトイン (27)
- fiddle (44)
-
irb
/ context (11) -
irb
/ inspector (11) - monitor (11)
-
rexml
/ document (11)
クラス
-
ARGF
. class (11) -
Fiddle
:: Pointer (44) -
IRB
:: Context (11) -
IRB
:: Inspector (11) -
REXML
:: Element (11) - Symbol (16)
キーワード
- +@ (11)
- -@ (11)
- MonitorMixin (11)
-
NEWS for Ruby 3
. 0 . 0 (4) -
add
_ namespace (11) -
def
_ inspector (11) -
inspect
_ mode= (11) - ptr (11)
-
ruby 1
. 6 feature (11) -
start
_ with? (5) -
to
_ proc (11) - write (11)
- メソッド呼び出し(super・ブロック付き・yield) (9)
検索結果
先頭5件
-
Fiddle
:: Pointer # ref -> Fiddle :: Pointer (15119.0) -
自身を指す Pointer オブジェクトを返します。 C 言語におけるポインタへのアドレス演算子の適用 &p と同じです。
...値には、free 関数がセットされず、size は 0 とされます。
例:
require 'fiddle'
s = 'abc'
cptr = Fiddle::Pointer[s]
cref = cptr.ref
p cref.to_s(4).unpack('l*')[0] #=> 136121648
p cptr.to_i #=> 136121648
p cref.ptr.to_s #=> "abc"... -
メソッド呼び出し(super・ブロック付き・yield) (156.0)
-
メソッド呼び出し(super・ブロック付き・yield) * super * block * yield * block_arg * numbered_parameters * call_method
...す
レシーバが nil でない場合は通常のメソッド呼び出しが行われます。
//emlist[][ruby]{
foo = 13
foo&.to_s # => "13"
foo = nil
foo&.to_s # nil, not ""
//}
`&.' は要素代入(アトリビュート)に対しても使えます。
//emlist[][ruby]{
foo&.bar = "abc" # for... -
REXML
:: Element # add _ namespace(prefix , uri) -> self (112.0) -
名前空間を要素に追加します。
...。
引数が2個の場合は prefix と uri を指定します。
引数が1個の場合はデフォルトの namespace の uri を指定します。
既に同じ prefix が存在する場合はそれが上書きされます。
@param prefix 名前空間の prefix
@param uri 名前空間の uri......e 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
a.add_namespace("foo", "baz")
a.to_s # => "<a xmlns:foo='baz' xmlns='twiddle'/>"
//}... -
Symbol
# start _ with?(*prefixes) -> bool (106.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...self の先頭が prefixes のいずれかであるとき true を返します。
(self.to_s.start_with?と同じです。)
@param prefixes パターンを表す文字列または正規表現 (のリスト)
@see Symbol#end_with?
@see String#start_with?
//emlist[][ruby]{
:hello.start_with?("hel......l") #=> true
:hello.start_with?(/H/i) #=> true
# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}... -
NEWS for Ruby 3
. 0 . 0 (24.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-label:label-Static+analysis] foundation is
in......r hooks in a non-blocking context. 16786
* Ractor
* New class added to enable parallel execution. See rdoc-ref:ractor.md for more details.
* Random
* `Random::DEFAULT` now refers to the `Random` class instead of being a `Random` instance, so it can work with `Ractor`. 17322
* `Random......10
x.to_s
else
nil
end
end
foo(42)
//}
//emlist{
$ typeprof test.rb
# Classes
class Object
def foo : (Integer) -> String?
end
//}
== Miscellaneous changes
* Methods using `ruby2_keywords` will no longer keep empty keyword splats, those are now removed just as they are for method... -
ARGF
. class # write(str) -> Integer (22.0) -
処理対象のファイルに対して str を出力します。 str が文字列でなければ to_s による文字列化を試みます。 実際に出力できたバイト数を返します。
...処理対象のファイルに対して str を出力します。
str が文字列でなければ to_s による文字列化を試みます。
実際に出力できたバイト数を返します。
c:ARGF#inplace時にのみ使用できます。
@param str 出力する文字列を指定します... -
Fiddle
:: Pointer # -@ -> Fiddle :: Pointer (19.0) -
自身を指す Pointer オブジェクトを返します。 C 言語におけるポインタへのアドレス演算子の適用 &p と同じです。
...値には、free 関数がセットされず、size は 0 とされます。
例:
require 'fiddle'
s = 'abc'
cptr = Fiddle::Pointer[s]
cref = cptr.ref
p cref.to_s(4).unpack('l*')[0] #=> 136121648
p cptr.to_i #=> 136121648
p cref.ptr.to_s #=> "abc"... -
Fiddle
:: Pointer # +@ -> Fiddle :: Pointer (18.0) -
自身の指す値を Pointer にして返します。
...り値には、free 関数がセットされず、size は 0 とされます。
例:
require 'fiddle'
s = 'abc'
cptr = Fiddle::Pointer[s]
cref = cptr.ref
p cref.to_s(4).unpack('l*')[0] #=> 136121648
p cptr.to_i #=> 136121648
p cref.ptr.to_s #=> "abc"... -
Fiddle
:: Pointer # ptr -> Fiddle :: Pointer (18.0) -
自身の指す値を Pointer にして返します。
...り値には、free 関数がセットされず、size は 0 とされます。
例:
require 'fiddle'
s = 'abc'
cptr = Fiddle::Pointer[s]
cref = cptr.ref
p cref.to_s(4).unpack('l*')[0] #=> 136121648
p cptr.to_i #=> 136121648
p cref.ptr.to_s #=> "abc"... -
IRB
:: Context # inspect _ mode=(opt) (18.0) -
実行結果の出力方式を opt に設定します。
...実行結果の出力方式を opt に設定します。
@param opt 以下のいずれかを指定します。
: false, :to_s, :raw
出力結果を to_s したものを表示します。
: true, :p, :inspect
出力結果を inspect したものを表示します。
: :pp, :pretty_inspect
出... -
MonitorMixin (18.0)
-
スレッドの同期機構としてのモニター機能を提供するモジュールです。
...必要があります。
//emlist[include する例][ruby]{
require 'monitor'
class MyObject
include MonitorMixin
def initialize(val)
super()
@value = val
end
def to_s
synchronize {
@value.to_s
}
end
end
//}
以下も参考になります。
* 9384
* 9386...