Module: ZTK::DSL::Core::Dataset::ClassMethods Private

Defined in:
lib/ztk/dsl/core/dataset.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Author:

Instance Method Summary (collapse)

Instance Method Details

- (Object) dataset

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
20
21
22
23
# File 'lib/ztk/dsl/core/dataset.rb', line 16

def dataset
  klass = self.to_s.underscore.to_sym

  @@dataset        ||= {}
  @@dataset[klass] ||= []

  @@dataset[klass]
end

- (Object) next_id

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
40
41
42
43
44
45
46
# File 'lib/ztk/dsl/core/dataset.rb', line 37

def next_id
  klass = self.to_s.underscore.to_sym

  @@id        ||= {}
  @@id[klass] ||= 0

  @@id[klass] += 1

  @@id[klass]
end

- (Object) purge

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ztk/dsl/core/dataset.rb', line 25

def purge
  klass = self.to_s.underscore.to_sym

  @@dataset        ||= {}
  @@dataset[klass]   = []

  @@id             ||= {}
  @@id[klass]        = 0

  true
end