Sha256: 59e1585d08324199dcd3fc3d4908736df1a9b85dd20b67781cedabc5b8170a16
Contents?: true
Size: 586 Bytes
Versions: 11
Compression:
Stored size: 586 Bytes
Contents
module APIClientBase module Client module Attributes def self.included(base) base.include Virtus.model inherit_attributes!(base) end private def self.inherit_attributes!(klass) parent_module = klass.name.deconstantize.constantize return unless parent_module.respond_to?(:configuration) parent_module.configuration.rules.each do |rule| self.inherit_attribute!(klass, rule) end end def self.inherit_attribute!(klass, rule) klass.attribute rule[0] end end end end
Version data entries
11 entries across 11 versions & 1 rubygems