Sha256: ad87c03dc2c0a1971f8496ca7b016340db14e9dd3568e3b7c175b941d7af525b
Contents?: true
Size: 582 Bytes
Versions: 10
Compression:
Stored size: 582 Bytes
Contents
module Toy module Inheritance extend ActiveSupport::Concern module ClassMethods DuplicatedInstanceVariables = [ :attributes, :key_factory, :lists, :references, :adapter, ] def inherited(subclass) DuplicatedInstanceVariables.each do |name| subclass.instance_variable_set("@#{name}", send(name).dup) if respond_to?(name) end subclass.attribute(:type, String, :default => subclass.name) super end end def type read_attribute(:type) end end end
Version data entries
10 entries across 10 versions & 1 rubygems