Created
June 8, 2016 09:57
-
-
Save kenchan/45ab10c85366090244a584c1b1a61faf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cart extend ActiveRecord::Base | |
include MyPrittyPrintable | |
end | |
module MyPrittyPrintable | |
def pritty_print | |
# attribute_namesをぐるぐるまわしながらkey: valueを出す | |
end | |
end | |
c = Cart.new | |
c.pritty_print # => いいかんじの表示 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment