Help us understand the problem. What is going on with this article?

ฅ(・ω・ฅ){ pry でクラス階層を Ascii Art で出力する pry-aa_ancestors を作成した } #pry

More than 5 years have passed since last update.

:musical_score: 概要

pry でクラス階層を Ascii Art で出力する pry-aa_ancestors を作成しました。
※ オープンクラスと eval を使った evil な実装です

インストール

$ gem install pry-aa_ancestors
  • インストールの確認
$ pry --plugins
Installed Plugins:
--
aa_ancestors      Show the class hierarchy that is Ascii-Art format.

:closed_book: Help

$ pry
[1] pry(main)> help aa_ancestors
Show the class hierarchy that is Ascii-Art format.
    -h, --help      Show this message.

試用

:older_man::man::boy::baby: Standard class ( String ) hierarchy

$ pry
[2] pry(main)> aa_ancestors String
-----------------
|  BasicObject  |
-----------------
       |
-----------------
|    Kernel     |
-----------------
       |
-----------------
|PP::ObjectMixin|
-----------------
       |
-----------------
|    Object     |
-----------------
       |
-----------------
|  Comparable   |
-----------------
       |
-----------------
|    String     |
-----------------

:older_woman::woman::girl::baby: User defined class ( Child ) hierarchy

% pry
[1] pry(main)> module Extendable
[1] pry(main)* end
=> nil
[2] pry(main)> class Parent
[2] pry(main)* end  d
=> nil
[3] pry(main)> class Child < Parent
[3] pry(main)*   include Extendable
[3] pry(main)* end  d
=> Child
[4] pry(main)> aa_ancestors Child
-----------------
|  BasicObject  |
-----------------
       |
-----------------
|    Kernel     |
-----------------
       |
-----------------
|PP::ObjectMixin|
-----------------
       |
-----------------
|    Object     |
-----------------
       |
-----------------
|    Parent     |
-----------------
       |
-----------------
|  Extendable   |
-----------------
       |
-----------------
|     Child     |
-----------------

:books: 外部資料

tbpgr
Rubyを扱う人事(研修開発、エンジニア採用) Learning Designer。 tbpgr の読み方は(てぃーびー) 個人ブログでも色々と情報を垂れ流してます。 http://tbpgr.hatenablog.com/
http://tbpgr.hatenablog.com/
studist
「伝えることを、もっと簡単に」をミッションにビジュアルSOPマネジメントプラットフォームのBtoB SaaS「Teachme Biz」を開発・運営するスタートアップ
https://medium.com/studist-dev
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away