るりまサーチ

最速Rubyリファレンスマニュアル検索!
436件ヒット [401-436件を表示] (0.129秒)
トップページ > クエリ:i[x] > クエリ:class[x] > クエリ:to_s[x]

別のキーワード

  1. argf.class lines
  2. argf.class each
  3. argf.class each_line
  4. argf.class to_a
  5. class new

検索結果

<< < ... 3 4 5 >>

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (122.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

...自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。

@param state_or_hash 生...
...JSON::State.new の引数と同じ Hash を
指定します。

//emlist[例][ruby]{
require "json"

class
Person
attr :name, :age

def initialize(name, age)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "\...

NEWS for Ruby 3.0.0 (102.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...since Ruby 2.7.2).
Turn them on with `-W:deprecated` (or with `-w` to show other warnings too).
16345
* `$SAFE` and `$KCODE` are now normal global variables with no special behavior.
C-API methods related to `$SAFE` have been removed.
16131 17136
* yield in singleton class defini...
...ring its type signature, and prints the analysis result in RBS format.
* Though it supports only a subset of the Ruby language yet, we will continuously improve the coverage of language features, analysis performance, and usability.

//emlist[][ruby]{
# test.rb
def foo(x)
i
f x > 10
x.to_s...

NEWS for Ruby 2.7.0 (84.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ルか bugs.ruby-lang.org の issue を参照してください。

== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

* パターンマッチが実験的機能として導入されました。 14912

//emlist[][ruby]{
case [0, [1, 2, 3]]
i
n [a, [b, *c]]
p a #=> 0...
...「Warning[:deprecated] = false」
としてください。

==== 番号指定パラメータ

* 番号指定パラメータ(Numbered parameters)がデフォルトのブロックの仮引数として
導入されました。 4475

//emlist[][ruby]{
[1, 2, 10].map { _1.to_s(16) } #=...
...raise rescue [1, 2])
//}

* 特異クラス構文での yield は警告を表示するようになりました。
これは deprecated です。 15575
この警告は「-W:no-deprecated」オプションで止められます。

//emlist{
def foo
class
<< Object.new
yield #=> warning...

NEWS for Ruby 2.0.0 (72.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 1.9.3 以降の変更

=== 言語仕様の変更

* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に...
...コーディングを US-ASCII から UTF-8 に変更しました
* '_' で始まる使用されていない変数は警告しなくなりました

=== 組み込みクラスの更新

* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
I
O にある同名のメソ...
...義したときの名前ではなく呼び出したときの名前を返します。
* 非互換: Object#inspect は #to_s を呼び出さなくなりました。再定義された #to_s を呼び出すためです。

* LoadError
* 追加: LoadError#path ロードできなかったファ...

tracer (48.0)

実行トレース出力をとる機能を提供します。

...以下のようにコマンドラインから Kernel.#require する方法です。
hoge.rb の実行をすべてトレース出力します。

ruby -rtracer hoge.rb

もうひとつはソースからrequireする方法です。

require 'tracer'

とした後

Tracer.on

によりトレー...
...動作します。
require 'tracer'

class
Hoge
def Hoge.fuga(i)
"fuga #{i}"
end
end

Tracer.add_filter {|event, file, line, id, binding, klass|
event =~ /line/ and klass.to_s =~ /hoge/i
}
Tracer.on
for i in 0..3
puts Hoge.fuga(i) if i % 3 == 0
end
Tracer.off...

絞り込み条件を変える

<< < ... 3 4 5 >>