575件ヒット
[1-100件を表示]
(0.131秒)
ライブラリ
- ビルトイン (282)
- bigdecimal (22)
-
irb
/ context (11) - json (11)
- psych (83)
-
rubygems
/ source _ index (11) -
rubygems
/ specification (11) -
rubygems
/ version (11) -
win32
/ registry (11) -
yaml
/ store (19)
クラス
- BigDecimal (22)
-
Encoding
:: Converter (66) -
Encoding
:: InvalidByteSequenceError (11) -
Encoding
:: UndefinedConversionError (11) -
Gem
:: SourceIndex (11) -
Gem
:: Specification (11) -
Gem
:: Version (11) -
IRB
:: Context (11) - Object (33)
-
Psych
:: Visitors :: YAMLTree (11) - Rational (11)
- String (29)
-
Win32
:: Registry (11) -
YAML
:: Store (19)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - IO (11)
-
MAJOR
_ VERSION (11) -
MINOR
_ VERSION (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - Time (11)
- UndefinedConversionError (11)
-
_ dump (44) -
_ load (11) - convert (11)
-
dump
_ stream (11) -
error
_ bytes (11) -
error
_ char (11) -
insert
_ output (11) - inspect (11)
-
inspect
_ mode= (11) - irb (11)
- load (11)
-
marshal
_ dump (22) - new (30)
-
primitive
_ convert (44) -
psych
_ to _ yaml (11) - restore (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
safe
_ load (17) - spawn (44)
-
to
_ yaml (11) - undump (7)
検索結果
先頭5件
-
irb (26090.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......。
$ irb
irb(main):001:0>
あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。
irb(main):001:0> 1+2
3
irb(main):002:0> class Foo
irb(main):003:1> def foo
irb(main):004:2> print 1
irb(main):005:2> end
irb(main):006:1>......を inspect したものを表示します。
: :pp, :pretty_inspect
出力結果を pretty_inspect したものを表示します。
: :yaml, :YAML
出力結果を YAML 形式にしたものを表示します。
: :marshal, :Marshal, :MARSHAL, Marshal
出力結果を Marshal.#dump し... -
String
# dump -> String (21223.0) -
文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。
...に置き換えた文字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\000\01010\\\""
//}......字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\000\01010\\\""
//}
@see String#undump... -
Gem
:: SourceIndex # dump -> () (21117.0) -
自身を Marshal.#dump します。
...自身を Marshal.#dump します。... -
Psych
. dump(o , io , options = {}) -> () (18350.0) -
Ruby のオブジェクト o を YAML ドキュメントに変換します。
...変換します。
io に IO オブジェクトを指定した場合は、変換されたドキュメントが
その IO に書き込まれます。
指定しなかった場合は変換されたドキュメントが文字列としてメソッドの返り値と
なります。
options で出力に......下の指定できます。
: :version
YAML document に付加するバージョンを [major, minor] という配列、
もしくは文字列で指定します
: :header
出力にヘッダを付けるかどうかを真偽値で指定します
: :indentation
インデントのレベルを 1......:canonical
出力の style が canonical であるかどうかを真偽値で指定します
: :line_width
「好ましい」行幅を整数値で指定します
@param o 変換するオブジェクト
@param io 出力先
@param options 出力オプション
//emlist[例][ruby]{
# Dump an arr... -
JSON
. # dump(object , io = nil , limit = nil) -> String | IO (18325.0) -
与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
...@param io IO のように write メソッドを実装しているオブジェクトを指定します。
@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトをダンプできません。
@raise ArgumentError オブジェクトのネストの深さが limit を......します。
//emlist[例][ruby]{
require "json"
JSON.dump({ name: "tanaka", age: 19 }) # => "{\"name\":\"tanaka\",\"age\":19}"
//}
//emlist[例][ruby]{
require "json"
File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]......]]]]], f, 10) # => exceed depth limit (ArgumentError)
end
//}
@see Marshal, Marshal.#dump... -
Psych
. dump(o , options = {}) -> String (18250.0) -
Ruby のオブジェクト o を YAML ドキュメントに変換します。
...変換します。
io に IO オブジェクトを指定した場合は、変換されたドキュメントが
その IO に書き込まれます。
指定しなかった場合は変換されたドキュメントが文字列としてメソッドの返り値と
なります。
options で出力に......下の指定できます。
: :version
YAML document に付加するバージョンを [major, minor] という配列、
もしくは文字列で指定します
: :header
出力にヘッダを付けるかどうかを真偽値で指定します
: :indentation
インデントのレベルを 1......:canonical
出力の style が canonical であるかどうかを真偽値で指定します
: :line_width
「好ましい」行幅を整数値で指定します
@param o 変換するオブジェクト
@param io 出力先
@param options 出力オプション
//emlist[例][ruby]{
# Dump an arr... -
Marshal
. # dump(obj , limit = -1) -> String (18226.0) -
obj を指定された出力先に再帰的に出力します。
...を保持するもの。具体的には以下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブ......。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param obj ダンプする対象のオブジェクトを指定します。
@param port IO かその......サブクラスのインスタンスを指定します。
@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトを
ダンプできません。負の limit を指定すると深さチェックを行いません。
デフォルトは -1 で... -
Marshal
. # dump(obj , port , limit = -1) -> IO (18226.0) -
obj を指定された出力先に再帰的に出力します。
...を保持するもの。具体的には以下のイン
スタンス。Dir, File::Stat, IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブ......。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param obj ダンプする対象のオブジェクトを指定します。
@param port IO かその......サブクラスのインスタンスを指定します。
@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトを
ダンプできません。負の limit を指定すると深さチェックを行いません。
デフォルトは -1 で... -
Encoding
:: Converter # insert _ output(string) -> nil (9248.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
...param string 挿入する文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is ", "."]
ec.insert_out......r>")
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is <err>.", ""]
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
src = "\u{306F 3041 3068 2661 3002}" # U+2661 is not representable in iso-2022-jp
dst = ""
p ec.primitive_convert(s......#=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H".force_encoding("ISO-2022-JP"), "\xE3\ x80\x82"]
ec.insert_output "?" # state change required to output "?".
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> [... -
BigDecimal
# _ dump -> String (9229.0) -
BigDecimal._load で復元可能な文字列を返します。 Marshal.#dump から呼び出されます。
...BigDecimal._load で復元可能な文字列を返します。
Marshal.#dump から呼び出されます。
//emlist[][ruby]{
require 'bigdecimal'
inf = BigDecimal('Infinity') # => Infinity
s = Marshal.dump(inf) # => "\x04\bu:\x0FBigDecimal\x0F9:Infinity"
Marshal.load(s) # => In......finity
//}
@see BigDecimal._load, Marshal.#dump, Marshal.#load...