69件ヒット
[1-69件を表示]
(0.038秒)
種類
- インスタンスメソッド (44)
- ライブラリ (22)
- 文書 (3)
ライブラリ
-
rdoc
/ context (11) -
rexml
/ document (22)
クラス
-
RDoc
:: Context :: Section (11) -
RDoc
:: Options (11) -
REXML
:: DocType (22)
キーワード
-
NEWS for Ruby 3
. 1 . 0 (3) -
attribute
_ of (11) -
external
_ id (11) -
rexml
/ document (11) - rss (11)
検索結果
先頭5件
-
RDoc
:: Options # title -> String | nil (18218.0) -
ドキュメントのタイトルを返します。指定されていない場合は nil を返します。
...ドキュメントのタイトルを返します。指定されていない場合は nil を返します。... -
RDoc
:: Context :: Section # title -> String | nil (18202.0) -
section のタイトルを返します。
section のタイトルを返します。 -
rss (402.0)
-
RSS を扱うためのライブラリです。
...は,
例外 RSS::NotWellFormedError が発生します。well formed な
XML だが,RSS 0.9x/1.0/2.0, Atom のいずれでもない場合は,nil が
返ります.
例えば、RSS 1.0 をバリデーション付きでパースするには以下のよ
うにします。ここで、変数 rss_......id ではない RSS だった
場合はバリデーション無しでパースするには以下のように書きます。
require 'rss'
rss = nil
begin
rss = RSS::Parser.parse(rss_source)
rescue RSS::InvalidRSSError
rss = RSS::Parser.parse(rss_source, false)
end
これは rss_s......れます.
Hash:
{
:href => "...",
:type => "...",
:title => "...",
:media => "...",
:charset => "...",
:alternate => "...",
}
連想配列:
[
[:href, "..."],
[:type, "..."],
[:title, "..."],
[:media, "..."],
[:charset, "..."],
[:alternate,... -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (137.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...ributeという名前の属性が宣言されていない、
もしくはデフォルト値が宣言されていない、のいずれかの場合は nil を返します。
@param element 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype......ED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS
p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
/... -
rexml
/ document (132.0) -
DOM スタイルの XML パーサ。
...'pp'
Bookmark = Struct.new(:href, :title, :desc)
doc = REXML::Document.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<xbel version="1.0">
<bookmark href="http://www.ruby-lang.org/ja/">
<title>オブジェクト指向スクリプト言語 Ruby</title>
<desc>Rubyの公式サイト</d......e.com/">
<title>最速Rubyリファレンスマニュアル検索! | るりまサーチ</title>
<desc>Rubyリファレンスマニュアルを全文検索できる。
とても便利。
</desc>
</bookmark>
<bookmark href="https://github.com/rurema/bitclust">
<title>rurema/bitcl......|
href = bookmark.attribute("href").value
title_element = bookmark.elements["title"]
title = title_element ? title_element.text : nil
desc_element = bookmark.elements["desc"]
desc = desc_element ? desc_element.text : nil
Bookmark.new(href, title, desc)
end
pp bookmarks
# >> [#<struct Bo... -
REXML
:: DocType # external _ id -> String | nil (125.0) -
DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。
...DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の
いずれかの文字列を返します。
それ以外の場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML......me # => "html"
doctype.external_id # => "PUBLIC"
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT books (book+)>
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
]>
EOS
doctype.name # => "books"
doctype.external_id # => nil
//}... -
NEWS for Ruby 3
. 1 . 0 (84.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
....com/ruby/ruby/pull/1509
//emlist[Enumerable#each_cons Enumerable#each_slice][ruby]{
[1, 2, 3].each_cons(2){}
# 3.0 => nil
# 3.1 => [1, 2, 3]
[1, 2, 3].each_slice(2){}
# 3.0 => nil
# 3.1 => [1, 2, 3]
//}
* Enumerator::Lazy
* 新規メソッド
* Enumerator::Lazy#compact が追加さ......unctionが引数を返すようになりました。引数が1つでも渡されている場合、それが返されます。引数なしの場合、nilが返されます。複数の引数を渡した場合、それらを要素に持つ配列が返されます。 12495
* Process
* 新規メ......ラー位置を表示します。
//emlist[例][ruby]{
title = json[:article][:title]
//}
jsonがnilの時、
//emlist{
$ ruby test.rb
test.rb:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)
title = json[:article][:title]
^^^^^^^^^^
//}
json[:article] が返す...