LoginSignup
1
0

More than 1 year has passed since last update.

名前空間を取り除いたクラス名を取得する ( ActiveSupport::Inflector.demodulize )

Last updated at Posted at 2018-05-02

require 'active_support/inflector'

module A
  class B
  end
end

p A::B.to_s.demodulize # B

環境

  • ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
  • activesupport (5.1.5)

参考

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0