Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ rails c
- [1] pry(main)> cd Item # Itemクラスに移動する
- [2] pry(Item):1> self # self: Itemクラス
- => Item(id: integer, user_id: integer, created_at: datetime, updated_at: datetime, ...)
- [3] pry(Item):1> first # Item.first
- => #<Item id: 1, user_id: 1, created_at: "2011-11-04 14:32:09", updated_at: "2011-11-04 14:32:09", ...>
- [4] pry(Item):2> cd first # Item.firstに移動する
- [5] pry(#<Item>):3> self # Item.first
- => #<Item id: 1, user_id: 1, created_at: "2011-11-04 14:32:09", updated_at: "2011-11-04 14:32:09", ... >
- [6] pry(#<Item>):3> user
- => #<User id: 1, url_name: "yaotti", ...>
- [7] pry(#<Item>):3> nesting # 移動した跡を見る
- Nesting status:
- --
- 0. main (Pry top level)
- 1. Item
- 2. #<Item>
- [8] pry(#<Item>):3> .ls # shellのコマンドを実行するときは先頭に.を付ける
- Capfile Guardfile Rakefile config doc public ...
- [9] pry(#<Item>):3> ^D # ctrl-dやexitを実行すると,1つ前のスコープに戻る
- [10] pry(Item):2>
Add Comment
Please, Sign In to add comment