Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2014-07-19から1日間の記事一覧

Ruby | Module | constants

概要 constants(inherit = true) -> [Symbol] 詳細 そのモジュール(またはクラス)で定義されている定数名の配列を返却。 サンプルコード class Hoge def self.const_missing(id) puts "@@@" Hoge.constants(id, 'dummy value') Hoge.const_get(id) end end #…