Sha256: 9890ee827ecdcde8d9ab14fc05e5c5c9ac1959da4ec2fcfd7933e73ea157792c
Contents?: true
Size: 635 Bytes
Versions: 9
Compression:
Stored size: 635 Bytes
Contents
module Fiveruns::Dash module Typable def self.included(base) name = Fiveruns::Dash::Util.shortname(base.name) base.class_eval %{ def self.#{name}_type @#{name}_type ||= begin short = Fiveruns::Dash::Util.shortname(name) short.sub(/_#{name}$/, '').to_sym end end } base.extend ClassMethods end module ClassMethods def inherited(klass) types[klass.__send__("#{Fiveruns::Dash::Util.shortname(name)}_type")] = klass end def types @types ||= {} end end end end
Version data entries
9 entries across 9 versions & 1 rubygems