804件ヒット
[1-100件を表示]
(0.110秒)
種類
- インスタンスメソッド (419)
- モジュール関数 (242)
- 特異メソッド (110)
- 文書 (22)
- クラス (11)
ライブラリ
- ビルトイン (99)
-
irb
/ cmd / chws (22) -
irb
/ cmd / pushws (33) -
irb
/ context (22) - json (77)
- objspace (110)
- prettyprint (33)
- rake (22)
-
rexml
/ document (209) -
rinda
/ rinda (66) -
rinda
/ tuplespace (66) - scanf (12)
-
webrick
/ httputils (11)
クラス
-
IRB
:: Context (22) -
IRB
:: ExtendCommand :: ChangeWorkspace (11) -
IRB
:: ExtendCommand :: CurrentWorkingWorkspace (11) -
IRB
:: ExtendCommand :: PopWorkspace (11) -
IRB
:: ExtendCommand :: PushWorkspace (11) -
IRB
:: ExtendCommand :: Workspaces (11) -
JSON
:: State (33) -
ObjectSpace
:: WeakMap (11) - PrettyPrint (33)
-
REXML
:: Attribute (11) -
REXML
:: Attributes (22) -
REXML
:: CData (11) -
REXML
:: DocType (11) -
REXML
:: Element (55) -
REXML
:: XPath (33) -
Rinda
:: TupleSpace (66) -
Rinda
:: TupleSpaceProxy (66) - String (12)
モジュール
- JSON (44)
- Kernel (11)
- ObjectSpace (187)
-
REXML
:: Namespace (66) -
Rake
:: TaskManager (11) -
WEBrick
:: HTTPUtils (11)
キーワード
- Ruby用語集 (11)
- UndefinedConversionError (11)
- [] (11)
-
_ id2ref (11) -
add
_ namespace (11) -
allocation
_ sourcefile (11) -
allocation
_ sourceline (11) - attribute (11)
-
count
_ nodes (11) -
count
_ objects _ size (11) -
count
_ tdata _ objects (11) -
define
_ finalizer (22) - each (11)
-
each
_ object (22) - escape (11)
- execute (55)
- first (11)
- format (11)
-
garbage
_ collect (11) - generate (11)
- genspace (11)
-
get
_ attribute _ ns (11) -
has
_ name? (11) -
in
_ namespace (11) -
local
_ name (11) - match (11)
-
memsize
_ of (11) -
memsize
_ of _ all (11) - name (11)
- namespace (33)
- namespaces (33)
- new (55)
- notify (22)
- prefix (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
reachable
_ objects _ from (11) - read (22)
-
read
_ all (22) - scanf (12)
-
singleline
_ format (11) -
space
_ before (11) - take (22)
-
trace
_ object _ allocations _ start (11) -
trace
_ object _ allocations _ stop (11) -
undefine
_ finalizer (11) - unparse (11)
- whitespace (11)
- workspace (11)
- write (22)
- 正規表現 (11)
検索結果
先頭5件
- JSON
:: State # space -> String - PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object - ObjectSpace
. # define _ finalizer(obj) {|id| . . . } -> Array - ObjectSpace
. # define _ finalizer(obj , proc) -> Array - ObjectSpace
. # undefine _ finalizer(obj) -> object
-
JSON
:: State # space -> String (18325.0) -
JSON 形式の文字列のトークン間に挿入する文字列を返します。
...す。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(space: "")
json_state.space # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON::State.new(space: "\t")
json_state.space... -
PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object (15500.0) -
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 PrettyPrint.format に似ていますが、改行しません。
...PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。
PrettyPrint.format に似ていますが、改行しません。
引数 maxwidth, newline と genspace は無視されます。ブロック中の breakable の実行は、
改行せずに text......の実行であるかのように扱います。
@param output 出力先を指定します。output は << メソッドを持っていなければなりません。
@param maxwidth 無視されます。
@param newline 無視されます。
@param genspace 無視されます。... -
ObjectSpace
. # define _ finalizer(obj) {|id| . . . } -> Array (15306.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...ロックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するの......す。proc は obj の回収時に obj の ID を引数として実行されます。
=== 使い方の注意
以下は、define_finalizer の使い方の悪い例です。
//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end
e......_finalizer(self, Bar.callback)
end
end
Bar.new
GC.start
//}
proc の呼び出しで発生した大域脱出(exitや例外)は無視されます。
これは、スクリプトのメイン処理が GC の発生によって非同期に中断され
るのを防ぐためです。不安なうちは -d... -
ObjectSpace
. # define _ finalizer(obj , proc) -> Array (15306.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...ロックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するの......す。proc は obj の回収時に obj の ID を引数として実行されます。
=== 使い方の注意
以下は、define_finalizer の使い方の悪い例です。
//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end
e......_finalizer(self, Bar.callback)
end
end
Bar.new
GC.start
//}
proc の呼び出しで発生した大域脱出(exitや例外)は無視されます。
これは、スクリプトのメイン処理が GC の発生によって非同期に中断され
るのを防ぐためです。不安なうちは -d... -
ObjectSpace
. # undefine _ finalizer(obj) -> object (15300.0) -
obj に対するファイナライザをすべて解除します。 obj を返します。
...す。
//emlist[例][ruby]{
class Sample
def Sample.callback
proc {
puts "finalize"
}
end
def initialize
ObjectSpace.define_finalizer(self, Sample.callback)
end
def undef
ObjectSpace.undefine_finalizer(self)
end
end
Sample.new
GC.start
# => finalize
Sample.new......sample.undef
GC.start
# ※何も出力されない
//}
@see ObjectSpace.#define_finalizer... -
Rake
:: TaskManager # in _ namespace(name) {|name _ space| . . . } -> Array (12401.0) -
与えられた名前の名前空間でブロックを評価します。
...ます。
@param name 名前を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
namespace :sample do
def hoge
puts "hoge"
end
end
task :test_rake_app do
task.application.in_namespace("sample") do
hoge # => "hoge"
end
end
//}... -
REXML
:: Element # whitespace -> bool (12300.0) -
要素(self)内で空白が考慮されるならば真を返します。
...ます。
これは、
* REXML::Element#context に :respect_whitespace も :compress_whitespace も
含まれない
* context の :respect_whitespace に self の要素名が含まれていて、
:compress_whitespace に self の要素名が含まれていない。
「含まれて......のには :all が指定されている場合と、
配列に含まれている場合の両方があります。
のいずれかの場合に真を返します。
要素名として REXML::Namespace#expanded_name が使われるので、
名前空間の prefix は判定に影響します。... -
IRB
:: Context # workspace -> IRB :: WorkSpace (9400.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。 -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (9400.0) -
属性の名前空間の URI を返します。
...の URI を返します。
URI が定義されていない場合は nil を返します。
@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。
//emlist[][ruby]{
require 'r......exml/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/ns"
//}... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (9400.0) -
namespace と name で特定される属性を返します。
...namespace と name で特定される属性を返します。
namespace で名前空間を、 name で prefix を含まない属性名を
指定します。
指定された属性が存在しない場合は nil を返します。
XML プロセッサが prefix を置き換えてしまった場合......うことで属性を正しく指定することができます。
@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.o......ot/a").first
a.attributes.get_attribute_ns("", "att") # => att='<'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...