264件ヒット
[201-264件を表示]
(0.076秒)
ライブラリ
- ビルトイン (156)
- json (12)
-
rexml
/ document (96)
クラス
- Module (72)
-
REXML
:: Attribute (36) -
REXML
:: Attributes (36) -
REXML
:: DocType (12) -
REXML
:: Element (12) - String (36)
-
Thread
:: Backtrace :: Location (48)
モジュール
キーワード
- [] (12)
-
absolute
_ path (12) -
add
_ element (12) -
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) -
attribute
_ of (12) -
base
_ label (12) - encode (36)
- inspect (12)
- namespace (12)
- namespaces (12)
- prefix (12)
- prefixes (12)
-
to
_ json (12) -
to
_ s (12) -
to
_ string (12)
検索結果
先頭5件
-
REXML
:: Element # add _ element(element , attrs = nil) -> Element (167.0) -
子要素を追加します。
...素を追加します。
attrs に { String => String } という Hash を渡すと、
追加する要素の属性を指定できます。
子要素の最後に追加されます。
返り値は追加された要素です。
@param element 追加する要素
@param attrs 追加する要素に設......る属性
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a/>')
el = doc.root.add_element 'my-tag' # => <my-tag/>
doc.root.to_s # => "<a><my-tag/></a>"
el = doc.root.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'}
# => <my-tag attr1='val1' attr2='val2'/>
doc.root.to_......s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/></a>"
el = REXML::Element.new 'my-tag'
doc.root.add_element el # => <my-tag/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/><my-tag/></a>"
//}
@see REXML::Elements#add, REXML::Element.new... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (114.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
...か、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
class Person
attr :name, :age
def initialize(name, age)
@name, @age = name, age
end
end
tanaka = Person.new("tanaka", 29)
tanaka.to_json... -
Thread
:: Backtrace :: Location # absolute _ path -> String (114.0) -
self が表すフレームの絶対パスを返します。
...self が表すフレームの絶対パスを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path... -
Thread
:: Backtrace :: Location # base _ label -> String (114.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...します。通常、
Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|... -
Thread
:: Backtrace :: Location # inspect -> String (114.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...cation#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|... -
Thread
:: Backtrace :: Location # to _ s -> String (114.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end...