232件ヒット
[1-100件を表示]
(0.091秒)
別のキーワード
ライブラリ
- ビルトイン (4)
- json (24)
- optparse (48)
- prettyprint (36)
- psych (24)
-
rexml
/ document (96)
クラス
-
JSON
:: State (24) - OptionParser (48)
- PrettyPrint (36)
-
Psych
:: Emitter (24) -
REXML
:: Attribute (12) -
REXML
:: Declaration (12) -
REXML
:: DocType (12) -
REXML
:: Document (24) -
REXML
:: Element (12) -
REXML
:: ExternalEntity (12) -
REXML
:: NotationDecl (12) - Refinement (4)
キーワード
- configure (12)
- group (12)
-
import
_ methods (4) - indentation (12)
- indentation= (12)
- merge (12)
- nest (12)
- summarize (24)
-
summary
_ indent (12) -
summary
_ indent= (12) - write (96)
検索結果
先頭5件
-
PrettyPrint
# indent -> Integer (24102.0) -
現在のインデントの深さを返します。
現在のインデントの深さを返します。 -
OptionParser
# summary _ indent=(indent) (9227.0) -
サマリを表示する時のインデントを文字列で指定します。
...@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")
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, --update\n", " -h, --help\n"]
//}... -
PrettyPrint
# group(indent = 0 , open _ obj = & # 39;& # 39; , close _ obj = & # 39;& # 39; , open _ width = open _ obj . length , close _ width = close _ obj . length) { . . . } -> () (9208.0) -
与えられたブロックを実行します。 ブロック内で自身に追加される文字列やオブジェクトは、1行にまとめて表示しても よい同じグループに属すると仮定されます。
...に属すると仮定されます。
もう少し詳しく説明します。pretty printing アルゴリズムはインデントと改行を、
ツリー構造を作ることによって決定します。そして、group メソッドは子ノードの作成と
子ノードのインデントの深......。
@param indent グループのインデントの深さを指定します。
@param open_obj 指定された場合、self.text(open_obj, open_width) がブロックが
実行される前に呼ばれます。開き括弧などを出力するのに使用されます。
@param clos......、self.text(close_obj, close_width) がブロックが
実行された後に呼ばれます。閉じ括弧などを出力するのに使用されます。
@param open_width open_obj のカラムを指定します。
@param close_width close_obj のカラムを指定します。... -
OptionParser
# summary _ indent -> String (9120.0) -
サマリを表示する時のインデントを文字列で返します。
...re "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 = " "
opts.s......ummary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
Psych
:: Emitter # indentation -> Integer (9101.0) -
インデントのレベルを返します。
...インデントのレベルを返します。
@see Psych::Emitter#indentation=... -
Psych
:: Emitter # indentation=(level) (9101.0) -
インデントのレベルを指定します。
...インデントのレベルを指定します。
1 から 9 までの整数で指定します。
@param level インデントレベル
@see Psych::Emitter#indentation... -
PrettyPrint
# nest(indent) { . . . } -> () (6124.0) -
自身の現在のインデントを indent だけ増加させてから、ブロックを実行し、元に戻します。
...自身の現在のインデントを indent だけ増加させてから、ブロックを実行し、元に戻します。
@param indent インデントの増加分を整数で指定します。... -
Refinement
# import _ methods(*modules) -> self (6119.0) -
モジュールからメソッドをインポートします。
...モジュールからメソッドをインポートします。
Module#includeと違って、import_methods はメソッドをコピーして
refinement に追加して、refinementでインポートしたメソッドを有効化します。
メソッドをコピーするため、Rubyコードで......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 which is not defined with Ruby code: Enumerable#drop... -
REXML
:: DocType # write(output , indent = 0 , transitive = false , ie _ hack = false) -> () (3214.0) -
output に DTD を出力します。
...output に DTD を出力します。
このメソッドは deprecated です。REXML::Formatter で
出力してください。
@param output 出力先の IO オブジェクト
@param indent インデントの深さ。指定しないでください。
@param transitive 無視されます。指定......しないでください。
@param ie_hack 無視されます。指定しないでください。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #......REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
<!ENTITY p "foobar publisher">
<!ENTITY % q "quzz">
]>
EOS
doctype.write(STDOUT)
# =>
# <!DOCTYPE books [
# <!ELEMENT book (comment)>
# ....
//}...