地味に忘れがちなobj.class . n a m e

kiyo_hikokiyo_hiko のブックマーク 2016/04/28 11:53

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

How do I get the name of a Ruby class?

    How can I get the class name from an ActiveRecord object? I have: result = User.find(1) I tried: result.class # => User(id: integer, name: string ...) result.to_s # => #<User:0x3d07cdc>" I need onl...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう