Sha256: 6b48947e1bda4833588964c6c4c03d5430d4211ac39ab8e7e55e4df330c0c232
Contents?: true
Size: 687 Bytes
Versions: 39
Compression:
Stored size: 687 Bytes
Contents
module ZTK::DSL::Core # @author Zachary Patten <zachary AT jovelabs DOT com> # @api private module Dataset def self.included(base) base.class_eval do base.send(:extend, ZTK::DSL::Core::Dataset::ClassMethods) end end # @author Zachary Patten <zachary AT jovelabs DOT com> module ClassMethods def dataset klass = self.to_s.underscore.to_sym @@dataset ||= {} if @@dataset.key?(klass) @@dataset[klass] else @@dataset[klass] ||= [] end end def purge @@dataset = nil end def id @@id ||= 0 (@@id += 1) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems