102件ヒット
[1-100件を表示]
(0.043秒)
種類
- インスタンスメソッド (47)
- モジュール関数 (22)
- ライブラリ (22)
- 文書 (11)
ライブラリ
- ビルトイン (3)
- json (44)
- optparse (11)
-
rexml
/ document (11)
クラス
-
JSON
:: State (22) - OptionParser (11)
- Refinement (3)
モジュール
- JSON (22)
-
REXML
:: Node (11)
キーワード
- Ruby用語集 (11)
- generate (11)
-
import
_ methods (3) - indent= (11)
- irb (11)
- pp (11)
-
summary
_ indent (11) -
to
_ s (11) - unparse (11)
検索結果
先頭5件
-
JSON
:: State # indent -> String (18214.0) -
インデントに使用する文字列を返します。
...インデントに使用する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//}... -
JSON
:: State # indent=(string) (6226.0) -
インデントに使用する文字列をセットします。
...デントに使用する文字列をセットします。
@param string インデントに使用する文字列を指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_stat......e)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.indent = " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}... -
OptionParser
# summary _ indent -> String (6220.0) -
サマリを表示する時のインデントを文字列で返します。
...s.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_indent = " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --updat... -
REXML
:: Node # to _ s(indent = -1) -> String (208.0) -
ノードを文字列に変換します。
...ノードを文字列に変換します。
@param indent このパラメータは deprecated で、無視されます... -
JSON
. # generate(object , state = nil) -> String (132.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...。
: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :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 that is put at the end of a JSON array (default: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環をチェックします。
この動作がデフォルトです。
: :allow_nan
真を... -
JSON
. # unparse(object , state = nil) -> String (132.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...。
: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :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 that is put at the end of a JSON array (default: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環をチェックします。
この動作がデフォルトです。
: :allow_nan
真を... -
Ruby用語集 (84.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...cent
: 0 オリジン
: zero-based
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まるこ......は
オブジェクトではない。
ただし、メソッド、ブロックはそれぞれオブジェクト化できる。
なお、「String オブジェクト」のような、クラス名+「オブジェクト」の
形の表現は、そのクラスのインスタンスを指す。......coding)、
文字列リテラルを凍結するかどうかを指定するもの(frozen_string_literal)、
インデント不整合の警告を出すかどうかを指定するもの(warn_indent)
がある。
参照:d:spec/m17n#magic_comment
: ミックスイン
: mix-in
モ... -
Refinement
# import _ methods(*modules) -> self (24.0) -
モジュールからメソッドをインポートします。
...てください。
//emlist[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end
module M
refine String do
import_methods StrUtils
end
end
using M
p "foo".indent(3) # => " foo"
module M
refine String do
import_methods Enumerable
# Can't import method... -
irb (24.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...) 式を .irbrc に記述すると、
irb コマンドのオプションを指定したのと同じ効果が得られます。
IRB.conf[:AUTO_INDENT] = false
IRB.conf[:BACK_TRACE_LIMIT] = 16
IRB.conf[:DEBUG_LEVEL] = 1
IRB.conf[:ECHO] = nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY......れます。
: help(*names)
: irb_help(*names)
RI から Ruby のドキュメントを参照します。
//emlist{
irb(main):001:0> help String#match
...
//}
names を指定しなかった場合は、RI を対話的なモードで起動します。メソッ
ド名などを入力す......irb(main):001:0> help
Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.
>> String#match
String#match
(from ruby core)
------------------------------------------------------------------------------
str.match(pattern)... -
pp (18.0)
-
オブジェクトなどを見やすく出力するためのライブラリです。
...tyPrint::Text:0x81a0a7c @tail=0, @width=1, @text=",">, #<PrettyPrint::Break
able:0x81a0a2c @group=2, @gensace=#<Proc:0x81a0cc0>, @newline="\n", @indent=1, @
tail=2, @sep=" ", @width=1>, #<PrettyPrint::Group:0x81a09c8 @group=2, @tail=1, @
buf=[#<PrettyPrint::Text:0x81a0950 @tail=1, @width=1, @t......ail=0, @text=",", @width=1>,
#<PrettyPrint::Breakable:0x40d0516
@genspace=#<Proc:0x40d0656>,
@group=2,
@indent=1,
@newline="\n",
@sep=" ",
@tail=2,
@width=1>,
#<PrettyPrint::Group:0x40d04e4
@b......xt(',')
q.breakable
end
q.pp k
q.text ' => '
q.group(1) do
q.breakable ''
if v.is_a?(String) and v.size > 10
q.pp(v[0..9] + '...')
else
q.pp v
end
end
first = false
}
e...