433件ヒット
[401-433件を表示]
(0.018秒)
ライブラリ
- ビルトイン (21)
- coverage (8)
- e2mmap (6)
-
irb
/ output-method (24) - json (36)
-
minitest
/ unit (1) - pp (136)
- prettyprint (24)
- prime (72)
-
ripper
/ filter (36) -
ripper
/ sexp (24)
クラス
- Coverage (8)
-
IRB
:: OutputMethod (24) - Integer (24)
-
JSON
:: State (24) - Object (72)
- PP (72)
- PrettyPrint (24)
- Prime (48)
- Ripper (24)
-
Ripper
:: Filter (36) - String (1)
モジュール
- Exception2MessageMapper (6)
- Kernel (24)
-
MiniTest
:: Assertions (1)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
SCRIPT
_ LINES _ _ (12) -
append
_ as _ bytes (1) - coverage (8)
- debug (12)
- each (48)
-
each
_ prime (24) -
extend
_ object (6) - format (12)
- irb (12)
- jj (12)
-
mu
_ pp (1) -
object
_ group (12) -
on
_ XXX (12) -
on
_ default (12) - parse (12)
- ppx (12)
-
pretty
_ inspect (12) -
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
pretty
_ print _ inspect (12) -
pretty
_ print _ instance _ variables (12) - sexp (12)
-
sexp
_ raw (12) -
sharing
_ detection (12) -
sharing
_ detection= (12) -
singleline
_ format (12) -
singleline
_ pp (12) - start (8)
-
to
_ h (12) -
to
_ hash (12)
検索結果
-
irb (24.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...# サブ irb を起動
irb#1(main):001:0> x # x を表示
NameError: undefined local variable or method `x' for main:Object
from (irb#1):1:in `Kernel#binding'
起動時のインタプリタでローカル変数 x を定義しましたが、
「irb」でサブ irb......ところが、 irb ではエラーになります。
irb(main):001:0> eval "foo"
NameError (undefined local variable or method `foo' for main:Object)
irb(main):002:0> foo = 0
この違いは、Ruby スクリプト と irb の構文解析のタイミングの差に起因します。 Ruby は......raw
出力結果を to_s したものを表示します。
: true, :p, :inspect
出力結果を inspect したものを表示します。
: :pp, :pretty_inspect
出力結果を pretty_inspect したものを表示します。
: :yaml, :YAML
出力結果を YAML 形式にしたもの... -
JSON
:: State # to _ h -> Hash (18.0) -
自身をハッシュに変換します。
...身をハッシュに変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
#... -
JSON
:: State # to _ hash -> Hash (18.0) -
自身をハッシュに変換します。
...身をハッシュに変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
#...