別のキーワード
ライブラリ
クラス
- Array (42)
-
CSV
:: Table (48) - Data (3)
-
Fiddle
:: Pointer (12) - Hash (327)
-
JSON
:: Parser (12) - MatchData (16)
- Module (12)
- Object (12)
-
ObjectSpace
:: WeakMap (12) -
OpenSSL
:: ASN1 :: ASN1Data (12) - OpenStruct (14)
- OptionParser (144)
-
REXML
:: Attribute (12) -
REXML
:: Attributes (36) -
REXML
:: DocType (12) -
REXML
:: Element (72) -
Rake
:: TaskArguments (12) - String (12)
- Struct (55)
- Thread (24)
- TracePoint (12)
- UncaughtThrowError (11)
-
WIN32OLE
_ VARIANT (12)
モジュール
- Enumerable (19)
キーワード
- [] (36)
- []= (48)
-
add
_ attribute (24) -
add
_ attributes (12) -
attributes
_ of (12) - bytebegin (2)
- byteend (2)
- compact (9)
- compact! (9)
-
const
_ set (12) -
delete
_ if (12) - each (36)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ key (12) -
each
_ pair (24) -
each
_ value (12) - fetch (36)
-
fetch
_ values (22) - filter (14)
- filter! (14)
-
get
_ text (12) -
instance
_ variable _ set (12) -
keep
_ if (19) - on (144)
- pack (21)
- parse (12)
-
return
_ value (12) - select (24)
- select! (24)
- shift (12)
- store (12)
- text (12)
-
thread
_ variable _ set (12) -
to
_ h (64) -
to
_ string (12) -
to
_ value (12) -
transform
_ values (18) -
transform
_ values! (18) - unpack (12)
- values (24)
-
values
_ at (60)
検索結果
先頭5件
-
WIN32OLE
_ VARIANT # value -> object (21352.0) -
値に対応するRubyオブジェクトを取得します。
...値に対応するRubyオブジェクトを取得します。
@return 値に対応するRubyのオブジェクトを返します。
obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR)
obj.value # => "1" (VT_BSTRを指定して生成したので、Stringオブジェクトとなる)... -
UncaughtThrowError
# value -> object (21348.0) -
Kernel.#throw に指定した value を返します。
...Kernel.#throw に指定した value を返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end
//}... -
OpenSSL
:: ASN1 :: ASN1Data # value -> object (21340.0) -
ASN.1 値に対応するRubyのオブジェクトを返します。
...ASN.1 値に対応するRubyのオブジェクトを返します。
@see OpenSSL::ASN1::ASN1Data#value=... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (18419.0) -
各属性に対しブロックを呼び出します。
...ML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").......first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}... -
Thread
# thread _ variable _ set(key , value) (15336.0) -
引数 key で指定した名前のスレッドローカル変数に引数 value をセットしま す。
... value をセットしま
す。
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、セットした変数は Fiber を切り替えても共通で使える事に注意してく
ださい。
//emlist[例][ruby]{
thr = Thread.new do
Thread.current.thr......ead_variable_set(:cat, 'meow')
Thread.current.thread_variable_set("dog", 'woof')
end
thr.join # => #<Thread:0x401b3f10 dead>
thr.thread_variables # => [:dog, :cat]
//}
@see Thread#thread_variable_get, Thread#[]... -
CSV
:: Table # values _ at(indices _ or _ headers) -> Array (15225.0) -
デフォルトのミックスモードでは、インデックスのリストを与えると行単位の 参照を行い、行の配列を返します。他の方法は列単位の参照と見なします。行 単位の参照では、返り値は行ごとの配列を要素に持つ配列です。
...つ配列です。
探索方法を変更したい場合は CSV::Table#by_col!,
CSV::Table#by_row! を使用してください。
アクセスモードを混在させることはできません。
//emlist[例 ロウモード][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row......1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.values_at(1) # => [#<CSV::Row "header1":"row2_1" "header2":"row2_2">]
//}
//emlist[例 カラムモード][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1",......"row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table.by_col!
table.values_at(1) # => [["row1_2"], ["row2_2"]]
//}
@see CSV::Table#by_col!, CSV::Table#by_row!... -
REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (12425.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
...TD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている
属性の名前とデフォルト値を REXML::Attribute の配列で返します。
名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Att......ribute#value で表現されます。
//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">
]>
EOS
p doctype.attributes_of("book")
# => [author='', title='', publisher='foobar publisher']
p doctype.attributes_of("book")[0].name # => "author"
p doctype.attributes_of("book")[0].value # => ""
//}... -
MatchData
# bytebegin(n) -> Integer | nil (12379.0) -
n 番目の部分文字列先頭のバイトオフセットを返します。
...。
//emlist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.bytebegin(0) # => 2
p $~.bytebegin(1) # => 2
p $~.bytebegin(2) # => 6
p $~.bytebegin(3) # => 13
p $~.bytebegin(4) # => index 4 out of matches (IndexE......rror)
//}
//emlist[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.bytebegin(:key) # => 0
$~.bytebegin(:value) # => 6
$~.bytebegin(:foo) # => undefined group name reference: foo... -
MatchData
# bytebegin(name) -> Integer | nil (12379.0) -
n 番目の部分文字列先頭のバイトオフセットを返します。
...。
//emlist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.bytebegin(0) # => 2
p $~.bytebegin(1) # => 2
p $~.bytebegin(2) # => 6
p $~.bytebegin(3) # => 13
p $~.bytebegin(4) # => index 4 out of matches (IndexE......rror)
//}
//emlist[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.bytebegin(:key) # => 0
$~.bytebegin(:value) # => 6
$~.bytebegin(:foo) # => undefined group name reference: foo... -
MatchData
# byteend(n) -> Integer | nil (12379.0) -
n 番目の部分文字列終端のバイトオフセットを返します。
...ist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.byteend(0) # => 15
p $~.byteend(1) # => 3
p $~.byteend(2) # => 12
p $~.byteend(3) # => 15
p $~.byteend(4) # => index 4 out of matches (IndexError)
//}
//emlist[......シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.byteend(:key) # => 4
$~.byteend(:value) # => 10
$~.byteend(:foo) # => undefined group name reference: foo (IndexError)
//}... -
MatchData
# byteend(name) -> Integer | nil (12379.0) -
n 番目の部分文字列終端のバイトオフセットを返します。
...ist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.byteend(0) # => 15
p $~.byteend(1) # => 3
p $~.byteend(2) # => 12
p $~.byteend(3) # => 15
p $~.byteend(4) # => index 4 out of matches (IndexError)
//}
//emlist[......シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.byteend(:key) # => 4
$~.byteend(:value) # => 10
$~.byteend(:foo) # => undefined group name reference: foo (IndexError)
//}... -
REXML
:: Element # add _ attributes(attrs) -> () (12361.0) -
要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...attrs には Hash もしくは Array を指定できます。
Hash の場合は、
{ "name1" => "value1", "name2" => "value2", ... }
という形で、配列の場合は
[ ["name1", "value1"], ["name2", "value2"], ... }
という形で追加/更新する属性を指定します。
@param attrs......属性の属性名と属性値の対の集合(Array or Hash)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("e")
e.add_attributes({"a" => "b", "c" => "d"})
e # => <e a='b' c='d'/>
e = REXML::Element.new("e")
e.add_attributes([["a", "b"], ["c", "d"]])
e # => <e a='b' c='d'/>
//}... -
REXML
:: Element # add _ attribute(attr) -> () (12356.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)
//emlist[]......[ruby]{
require 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
doc.root.add_attribute(REXML::Attribute.new("b", "d"))
doc.root # => <e a='b' x:a='c' b='d'/>
//}...