るりまサーチ

最速Rubyリファレンスマニュアル検索!
139件ヒット [1-100件を表示] (0.198秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

<< 1 2 > >>

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...
<< 1 2 > >>