るりまサーチ

最速Rubyリファレンスマニュアル検索!
70件ヒット [1-70件を表示] (0.061秒)
トップページ > クエリ:-[x] > クエリ:before[x] > クエリ:generate[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

JSON.#generate(object, state = nil) -> String (18231.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...ます。デフォルトは空文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string...
...on"

JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")
JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => "[1,2,{\"name\": \"tanaka\",\"age\": 19}]"
//}

@see JSON::State, JSON.#pretty_generate...

JSON::State#space_before -> String (6237.0)

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。

...te.new(space_before: "")
json_state.space_before # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json_state = JSON::State.new(space_before: " ")
json_state.space_before # => " "
puts JSON.generate([1, 2, { nam...

JSON.#unparse(object, state = nil) -> String (3131.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...ます。デフォルトは空文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string...
...on"

JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")
JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => "[1,2,{\"name\": \"tanaka\",\"age\": 19}]"
//}

@see JSON::State, JSON.#pretty_generate...

NEWS for Ruby 3.0.0 (306.0)

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

...mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in...
...kernel_sleep(...)` in a non-blocking execution context. 16786
* Module
* Module#include and Module#prepend now affect classes and modules that have already included or prepended the receiver, mirroring the behavior if the arguments were included in the receiver before the other modules and cla...
...rozen?`
* `Integer`: `#-@`, `#~`, `#abs`, `#bit_length`, `#even?`, `#integer?`, `#magnitude`, `#odd?`, `#ord`, `#to_i`, `#to_int`, `#zero?`
* `Struct`: reader methods for 10th or later members
* Constant references are inlined.
* Always generate appropriate code for `==`, `ni...

CSV.new(data, options = Hash.new) -> CSV (136.0)

このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。

...をラップします。

ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用してください。
他の位置から処理したい場合はあらかじめそのように設定した StringIO を渡してくだ...
...ode on Windows if this
feature will be used as the line-ending translation can cause
problems with resetting the document position to where it was before the
read ahead. This String will be transcoded into the data's Encoding before parsing.
: :quote_char
フィールドをクオート...
...が一つだけ
の場合は配列に格納する必要はありません。
全ての組み込みの変換器は、値を変換する前に UTF-8 にエンコーディング変
換を試みます。エンコーディング変換に失敗した場合はフィールドは変換さ
れませ...

絞り込み条件を変える

rubygems/commands/lock_command (72.0)

指定された特定のバージョンの Gem パッケージに依存する Gem を使用するために 必要な Kernel#gem メソッドの呼び出し方法を文字列で出力します。

...m lock GEMNAME-VERSION [GEMNAME-VERSION ...] [options]
Options:
-
s, --[no-]strict 依存関係を満たせない場合に失敗します
Common Options:
-
h, --help このコマンドのヘルプを表示します
-
V, --[no-]verbose...
...特定バージョンの Gem パッケージを使用するために必要な記述を表示します
Description:
The lock command will generate a list of +gem+ statements that will lock
down
the versions for the gem given in the command line. It will specify exact
vers...
...rb is loaded *before* any
other require statements.

Notice that rails 1.0.0 only requires that rake 0.6.2 or better be used.
Rake-0.7.0.1 is the most recent version installed that satisfies that, so we
lock it down to the exact version.
Defaults:
-
-no-strict...

CSV (30.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...e.csv", "wb") do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end

# 文字列へ書き込み
csv_string = CSV.generate do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end
//}

=== 一行変換

//emlist[][ruby]{
require 'csv'

cs...
...rtant to note that while all of CSV's core parser is now
Encoding agnostic, some features are not. For example, the built-in
converters will try to transcode data to UTF-8 before making conversions.
Again, you can provide custom converters that are aware of your Encodings to
avoid this translation....
...is not ASCII compatible. There's no existing data for CSV to use to
prepare itself and thus you will probably need to manually specify the desired
Encoding for most of those cases. It will try to guess using the fields in a
row of output though, when using CSV::generate_line() or Array#to_csv()....