516件ヒット
[1-100件を表示]
(0.145秒)
別のキーワード
ライブラリ
- ビルトイン (12)
- csv (12)
- erb (24)
- json (108)
-
json
/ add / struct (12) - logger (24)
- optparse (168)
- pathname (48)
-
rake
/ packagetask (12) -
rexml
/ document (84) - socket (12)
クラス
- Addrinfo (12)
- CSV (12)
- ERB (24)
-
JSON
:: Parser (12) -
JSON
:: State (72) - Logger (24)
- Module (12)
- OptionParser (168)
- Pathname (48)
-
REXML
:: Attribute (24) -
REXML
:: Attributes (24) -
REXML
:: DocType (12) -
REXML
:: Element (24) -
Rake
:: PackageTask (12) - Struct (12)
キーワード
- [] (12)
- autoload (12)
- binread (12)
- canonname (12)
-
col
_ sep (12) -
external
_ id (12) - filename (12)
- filename= (12)
- formatter (12)
- namespace (24)
- namespaces (24)
-
object
_ nl (12) -
object
_ nl= (12) - on (144)
- progname (12)
-
program
_ name (12) - source (12)
- space (12)
- space= (12)
-
space
_ before (12) -
space
_ before= (12) - sub (24)
-
to
_ json (36) -
to
_ s (12) -
to
_ string (12) - ver (12)
検索結果
先頭5件
-
Rake
:: PackageTask # name -> String (21321.0) -
バージョン情報を含まないパッケージの名前を返します。
...バージョン情報を含まないパッケージの名前を返します。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'rake/packagetask'
Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.name # => "sample"
end
//}... -
REXML
:: Attribute # to _ string -> String (12337.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (12238.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
...自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。
@param state_or_hash 生......State のインスタンスか、
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("ta......naka", 29)
tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}... -
JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String (12226.0) -
自身から生成した JSON 形式の文字列を返します。
...@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"......person = { "name" => "tanaka", "age" => 19 }
person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"
//}... -
REXML
:: Attributes # namespaces -> { String => String } (9515.0) -
self の中で宣言されている名前空間の集合を返します。
...ist[][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
p doc.root.attributes.namespaces
# => {"foo"=>"http:......//example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}... -
REXML
:: Element # namespaces -> {String => String} (9515.0) -
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"}
//}... -
OptionParser
# program _ name -> String (9321.0) -
プログラムの名前を文字列で返します。
...字列で返します。
デフォルトは $0 が使われます。
@return プログラムの名前を文字列で返します。
//emlist[例][ruby]{
require "optparse"
OptionParser.new do |opts|
p $0 # => /path/to/filename.rb
p opts.program_name # => filename
end
//}... -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (9314.0) -
属性の名前空間の 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.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/... -
REXML
:: Element # namespace(prefix=nil) -> String (9314.0) -
self の文脈で prefix が指している名前空間の URI を返します。
...します。
//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"
b.namespace("y") # => "2"
b.namespace("z") # => nil
d = doc.elements['//y:d']
d.namespace # => "2"
//}...