ライブラリ
- ビルトイン (5)
-
rexml
/ document (11) -
rubygems
/ package / tar _ header (1)
クラス
-
Gem
:: Package :: TarHeader (1) -
REXML
:: Attribute (2) -
REXML
:: Attributes (2) -
REXML
:: Element (3) - String (5)
モジュール
-
REXML
:: Namespace (4)
キーワード
-
delete
_ prefix (1) -
delete
_ prefix! (1) -
delete
_ suffix (1) -
delete
_ suffix! (1) -
local
_ name (1) - name (1)
- namespace (2)
- namespaces (2)
- prefixes (2)
-
start
_ with? (1)
検索結果
先頭5件
-
String
# delete _ prefix(prefix) -> String (82105.0) -
文字列の先頭から prefix を削除した文字列のコピーを返します。
文字列の先頭から prefix を削除した文字列のコピーを返します。
@param prefix 先頭から削除する文字列を指定します。
@return 文字列の先頭から prefix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
//}
@see String#delete_prefix!
@see String#delete_suffix
@see String#start_with? -
String
# delete _ prefix!(prefix) -> self | nil (81784.0) -
self の先頭から破壊的に prefix を削除します。
self の先頭から破壊的に prefix を削除します。
@param prefix 先頭から削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}
@see String#delete_prefix
@see String#delete_suffix!
@see String#start_with? -
String
# start _ with?(*prefixes) -> bool (63484.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
self の先頭が prefixes のいずれかであるとき true を返します。
@param prefixes パターンを表す文字列または正規表現 (のリスト)
//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"strin... -
String
# delete _ suffix(suffix) -> String (63415.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
文字列の末尾から suffix を削除した文字列のコピーを返します。
@param suffix 末尾から削除する文字列を指定します。
@return 文字列の末尾から suffix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}
@see String#chomp
@see String#chop
@see String#delete_prefix
@see String#delete_suffix!
... -
String
# delete _ suffix!(suffix) -> self | nil (63112.0) -
self の末尾から破壊的に suffix を削除します。
self の末尾から破壊的に suffix を削除します。
@param suffix 末尾から削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_suffix!("llo") # => "he"
"hello".delete_suffix!("hel") # => nil
//}
@see String#chomp!
@see String#chop!
@see String#delete_prefix!
@see String#delete_suffix
@see S... -
REXML
:: Namespace # prefix -> String (54676.0) -
prefix (前置修飾子) を返します。
prefix (前置修飾子) を返します。
@see REXML::Namespace#prefix= -
REXML
:: Attribute # prefix -> String (54664.0) -
属性の名前空間を返します。
属性の名前空間を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "elns"
a = REXML::Attribute... -
Gem
:: Package :: TarHeader # prefix -> String (54658.0) -
tar のヘッダに含まれる prefix を返します。
tar のヘッダに含まれる prefix を返します。 -
REXML
:: Element # prefixes -> [String] (18673.0) -
self の文脈で定義されている prefix を文字列の配列を返します。
self の文脈で定義されている prefix を文字列の配列を返します。
対象の要素とその外側の要素で定義されている prefix を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].prefixes # => ["x", "y"]
//} -
REXML
:: Attributes # prefixes -> [String] (18655.0) -
self の中で宣言されている prefix の集合を 文字列の配列で返します。
self の中で宣言されている prefix の集合を
文字列の配列で返します。
self が属する要素より上位の要素で定義されているものは含みません。
//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... -
REXML
:: Element # namespace(prefix=nil) -> String (694.0) -
self の文脈で prefix が指している名前空間の URI を返します。
self の文脈で prefix が指している名前空間の URI を返します。
prefix を省略すると、デフォルトの名前空間の URI を返します。
prefix で指示される名前空間の宣言が存在しない場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/><y:d /></a>")
b = doc.elements['//b']
b.namespace # => "1"
... -
REXML
:: Attributes # namespaces -> { String => String } (628.0) -
self の中で宣言されている名前空間の集合を返します。
self の中で宣言されている名前空間の集合を返します。
返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。
//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.ge... -
REXML
:: Element # namespaces -> {String => String} (628.0) -
self の文脈で定義されている名前空間の情報を返します。
self の文脈で定義されている名前空間の情報を返します。
対象の要素とその外側の要素で定義されている名前空間を、{ prefix => 識別子 }
というハッシュテーブルで返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"}
//} -
REXML
:: Namespace # expanded _ name -> String (379.0) -
REXML::Namespace#name= で設定された名前を返します。
REXML::Namespace#name= で設定された名前を返します。
name= で指定した名前が prefix を含んでいれば
prefix を含む名前を返し、そうでなければ
prefix を含まない名前を返します。
@see REXML::Namespace#prefix -
REXML
:: Namespace # local _ name -> String (358.0) -
prefix を含まない「ローカルな」名前を返します。
prefix を含まない「ローカルな」名前を返します。 -
REXML
:: Namespace # name -> String (358.0) -
prefix を含まない「ローカルな」名前を返します。
prefix を含まない「ローカルな」名前を返します。 -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (325.0) -
属性の名前空間の URI を返します。
属性の名前空間の URI を返します。
URI が定義されていない場合は nil を返します。
@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e....