249件ヒット
[1-100件を表示]
(0.163秒)
別のキーワード
ライブラリ
- ビルトイン (69)
- optparse (144)
-
rexml
/ document (24) - win32ole (12)
クラス
- Array (21)
- MatchData (12)
- Module (12)
- OptionParser (144)
-
REXML
:: Attribute (12) -
REXML
:: Element (12) - String (12)
- Struct (12)
-
WIN32OLE
_ VARIANT (12)
検索結果
先頭5件
-
String
# unpack(template) -> Array (25839.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...ンプレート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack
のテンプレ......ト文字のシステム依存性
各テンプレート文字の説明の中で、
short や long はシステムによらずそれぞれ 2, 4バイトサ
イズの数値(32ビットマシンで一般的なshort, longのサイズ)を意味していま
す。s, S, l, L に対しては直後に _ ま......テム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられない)ことに注意してください。
つまり、IO#ioctl などで C の構......ート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテ... -
WIN32OLE
_ VARIANT # value -> object (21358.0) -
値に対応するRubyオブジェクトを取得します。
...値に対応するRubyオブジェクトを取得します。
@return 値に対応するRubyのオブジェクトを返します。
obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR)
obj.value # => "1" (VT_BSTRを指定して生成したので、Stringオブジェクトとなる)... -
REXML
:: Attribute # to _ string -> String (15337.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}... -
MatchData
# values _ at(*index) -> [String] (12326.0) -
正規表現中の n 番目の括弧にマッチした部分文字列の配列を返します。
...t[例][ruby]{
m = /(foo)(bar)(baz)/.match("foobarbaz")
# same as m.to_a.values_at(...)
p m.values_at(0, 1, 2, 3, 4) # => ["foobarbaz", "foo", "bar", "baz", nil]
p m.values_at(-1, -2, -3, -4, -5) # => ["baz", "bar", "foo", nil, nil]
m = /(?<a>\d+) *(?<op>[+\-*\/]) *(?<b>\d+)/.match("1 + 2")
m.t......o_a # => ["1 + 2", "1", "+", "2"]
m.values_at(:a, :b, :op) # => ["1", "2", "+"]
//}
@see Array#values_at, Array#[]... -
Module
# const _ set(name , value) -> object (6364.0) -
モジュールに name で指定された名前の定数を value とい う値として定義し、value を返します。
...を value とい
う値として定義し、value を返します。
そのモジュールにおいてすでにその名前の定数が定義されている場合、警
告メッセージが出力されます。
@param name Symbol,String で定数の名前を指定します。
@param value セッ......す。
//emlist[例][ruby]{
module Foo; end
# Symbolを指定した場合
Foo.const_set(:FOO, 123)
Foo::FOO # => 123
# Stringを指定した場合
Foo.const_set('BAR', 'abc')
Foo::BAR # => "abc"
# 既に定義されている定数の名前を指定した場合
Foo.const_set('BAR', '123')
# warni......ng: already initialized constant Foo::BAR
# warning: previous definition of BAR was here
# => "123"
# 不適切な定数名を指定した場合
Foo.const_set('foo', 1) # => NameError: wrong constant name foo
//}... -
REXML
:: Element # text(path = nil) -> String | nil (6232.0) -
先頭のテキスト子ノードの文字列を返します。
...:Text#value も参照してください。
path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#get_text
//emlist[......][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.text # => "some text "
//}... -
OptionParser
# on(long , klass = String , desc = "") {|v| . . . } -> self (3269.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...な引数クラス」を参照して下さい。
OptionParser.accept や OptionParser#accept によって、受け付け
るクラスを増やすことができます。登録されていないクラスが指定された
場合、例外 ArgumentError を投げます。
また、登録されたクラ......ptionParser::InvalidArgument を投げます。
オプションの引数は accept で登録したブロックで klass のインスタンス
に変換されてから、ブロックに渡されます。
opts.on("-w", "--width N", Integer){|w|
p w.class #=> Integer
}
# ruby command --widt......h=32
opts.on("-o", "--overwrite VALUE", TrueClass){|boolean| ...}
# ruby command --overwrite yes
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param klass オプションの引数... -
OptionParser
# on(short , klass = String , desc = "") {|v| . . . } -> self (3269.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...な引数クラス」を参照して下さい。
OptionParser.accept や OptionParser#accept によって、受け付け
るクラスを増やすことができます。登録されていないクラスが指定された
場合、例外 ArgumentError を投げます。
また、登録されたクラ......ptionParser::InvalidArgument を投げます。
オプションの引数は accept で登録したブロックで klass のインスタンス
に変換されてから、ブロックに渡されます。
opts.on("-w", "--width N", Integer){|w|
p w.class #=> Integer
}
# ruby command --widt......h=32
opts.on("-o", "--overwrite VALUE", TrueClass){|boolean| ...}
# ruby command --overwrite yes
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param klass オプションの引数... -
OptionParser
# on(short , long , klass = String , desc = "") {|v| . . . } -> self (3269.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...な引数クラス」を参照して下さい。
OptionParser.accept や OptionParser#accept によって、受け付け
るクラスを増やすことができます。登録されていないクラスが指定された
場合、例外 ArgumentError を投げます。
また、登録されたクラ......ptionParser::InvalidArgument を投げます。
オプションの引数は accept で登録したブロックで klass のインスタンス
に変換されてから、ブロックに渡されます。
opts.on("-w", "--width N", Integer){|w|
p w.class #=> Integer
}
# ruby command --widt......h=32
opts.on("-o", "--overwrite VALUE", TrueClass){|boolean| ...}
# ruby command --overwrite yes
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param klass オプションの引数...