概要
Module#name -> String
Module#to_s -> String
Module#inspect -> String
詳細
モジュールやクラスの名前を文字列で返却
サンプルコード
require 'tbpgr_utils' module Hogeable def hogeable end end class Hoge include Hogeable def hoge print 'hoge' end end bulk_puts_eval binding, <<-EOS Hogeable.name Hoge.name Module.new.name Class.new.name EOS __END__ 下記はTbpgrUtils gemの機能 bulk_puts_eval https://rubygems.org/gems/tbpgr_utils https://github.com/tbpgr/tbpgr_utils
出力
出力
Hogeable.name # => "Hogeable" Hoge.name # => "Hoge" Module.new.name # => nil Class.new.name # => nil