るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

JSON::State#indent=(string) (18112.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 = " "
JSON.generate({key1: "value1",...

OptionParser#summary_indent=(indent) (6112.0)

サマリを表示する時のインデントを文字列で指定します。

...ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.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 =...

OptionParser#summarize(to = [], width = self.summary_width, max = width - 1, indent= self.summary_indent) -> () (108.0)

サマリを指定された to へと加えていきます。

...max サマリの最大幅を整数で指定します。

@param indent サマリのインデントを文字列で指定します。

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

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
e...

OptionParser#summarize(to = [], width = self.summary_width, max = width - 1, indent= self.summary_indent) {|line| ... } -> () (108.0)

サマリを指定された to へと加えていきます。

...max サマリの最大幅を整数で指定します。

@param indent サマリのインデントを文字列で指定します。

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

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
e...

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...
...れているものは
PP のメソッドでもあります。

以下は Hash の pretty printing のカスタマイズの例です。

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

class Hash
def pretty_print(q)
q.group(2, "<hash>") do
q.breakable
first = true
self.each{|k, v|
unl...
...れているものは
PP のメソッドでもあります。

以下は Hash の pretty printing のカスタマイズの例です。

//emlist[][ruby]{
class Hash
def pretty_print(q)
q.group(2, "<hash>") do
q.breakable
first = true
self.each{|k, v|
unless first...

絞り込み条件を変える

OptionParser#summary_indent -> String (12.0)

サマリを表示する時のインデントを文字列で返します。

...ruby]{
require "optparse"

opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.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 =...

OptionParser.new(banner = nil, width = 32, indent = &#39; &#39; * 4) -> OptionParser (8.0)

OptionParser オブジェクトを生成して返します。

...nParser オブジェクトを引数としてブロックを評
価します。つまり、以下のような書き方が可能です。

//emlist[][ruby]{
require 'optparse'
OptionParser.new do |opt|

opt.on('-a') {|v| p v }
opt.on('-b') {|v| p v }

opt.parse!(ARGV)
end
//}

@param banner ヘ...

OptionParser.new(banner = nil, width = 32, indent = &#39; &#39; * 4) {|opt| ...} -> OptionParser (8.0)

OptionParser オブジェクトを生成して返します。

...nParser オブジェクトを引数としてブロックを評
価します。つまり、以下のような書き方が可能です。

//emlist[][ruby]{
require 'optparse'
OptionParser.new do |opt|

opt.on('-a') {|v| p v }
opt.on('-b') {|v| p v }

opt.parse!(ARGV)
end
//}

@param banner ヘ...

REXML::DocType#write(output, indent = 0, transitive = false, ie_hack = false) -> () (7.0)

output に DTD を出力します。

...transitive 無視されます。指定しないでください。
@param ie_hack 無視されます。指定しないでください。

//emlist[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<...
<< 1 2 > >>