るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.010秒)
トップページ > クエリ:sym[x] > 種類:ライブラリ[x]

別のキーワード

  1. handle sym
  2. fiddle sym
  3. _builtin to_sym
  4. string to_sym
  5. symbol to_sym

キーワード

検索結果

json/add/symbol (6001.0)

Symbol に JSON 形式の文字列に変換するメソッドや JSON 形式の文字列から Ruby のオブジェクトに変換するメソッドを定義します。

...Symbol に JSON 形式の文字列に変換するメソッドや JSON 形式の文字列から Ruby のオブジェクトに変換するメソッドを定義します。...

yaml (19.0)

構造化されたデータを表現するフォーマットであるYAML (YAML Ain't Markup Language) を扱うためのライブラリです。

...事ができます。


=== タグの指定

!ruby/sym :foo などのようにタグを指定することで、読み込み時に記述した値
の型を指定できます。

//emlist[例][ruby]{
require 'yaml'
p YAML.load(<<~EOS)
---
!ruby/sym :foo
EOS
# => :foo
//}

yaml では、Ruby 向け...
...!ruby/range: Range オブジェクト
* !ruby/string: String オブジェクト
* !ruby/struct: Struct オブジェクト
* !ruby/sym(もしくは !ruby/symbol): Symbol オブジェクト
* !ruby/encoding: Encoding オブジェクト
* !ruby/exception: 例外オブジェクト
* !ruby/object:<...
...リ以外で yaml を扱うライブラリを使用する場合な
どに注意してください。

* ":foo" のような文字列はそのまま Symbol として扱える
* "y" や "n" は真偽値として扱われない

=== 参考

YAML Specification

* https://yaml.org/spec/
* https://yam...

rexml/parsers/streamparser (7.0)

ストリーム式の XML パーサ。

...IRED xyz CDATA "foobar">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar"><![CDATA[cd...
...p;&amp; <!-- comment here--> &bar;
</root>
EOS

class Listener
def method_missing(name, *args)
p [name, *args]
end
def respond_to_missing?(sym, include_private)
true
end
end

REXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> [:xmldecl, "1.0", "UTF-8", nil]
# >> [:text, "...
...bar\">"]
# >> [:notationdecl, ["foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]]
# >> [:entitydecl, ["HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES Symbols for XHTML//EN", "xhtml-symbol.ent", "%"]]
# >> [:doctype_end]
# >> [:text, "\n"]
# >> [:tag_start, "root", {"xmlns:foo"=>"http://example.org...