Sha256: 0b74c9b97dc4e79a245bdbd7bf0065990e5eb127fb10e63901cca93538f81ba0
Contents?: true
Size: 840 Bytes
Versions: 12
Compression:
Stored size: 840 Bytes
Contents
module Quarto module InheritableAttributes # :nodoc: all def self.included(base) base.extend(ClassMethods) end module ClassMethods def read_inheritable_attribute(key) @inheritable_attributes ||= {} @inheritable_attributes[key] end def write_inheritable_array(key, elements) write_inheritable_attribute(key, []) if read_inheritable_attribute(key).nil? write_inheritable_attribute(key, read_inheritable_attribute(key) + elements) end def write_inheritable_attribute(key, value) @inheritable_attributes ||= {} @inheritable_attributes[key] = value end def write_inheritable_hash(key, hash) write_inheritable_attribute(key, {}) if read_inheritable_attribute(key).nil? write_inheritable_attribute(key, read_inheritable_attribute(key).merge(hash)) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems