Class: Nanoc::Core::OutdatednessStore Private

Inherits:
Store
  • Object
show all
Includes:
ContractsSupport
Defined in:
lib/nanoc/core/outdatedness_store.rb

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

Instance Attribute Summary

Attributes inherited from Store

#filename, #version

Instance Method Summary collapse

Methods included from ContractsSupport

enabled?, included, setup_once, warn_about_performance

Methods inherited from Store

#load, #store, tmp_path_for, tmp_path_prefix

Constructor Details

#initialize(config:) ⇒ OutdatednessStore

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.

Returns a new instance of OutdatednessStore.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/nanoc/core/outdatedness_store.rb', line 10

def initialize(config:)
  super(
    self.class.tmp_path_for(
      config:,
      store_name: 'outdatedness',
    ),
    2,
  )

  @outdated_refs = Set.new
end

Instance Method Details

#add(obj) ⇒ Object

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.



28
29
30
31
# File 'lib/nanoc/core/outdatedness_store.rb', line 28

def add(obj)
  @outdated_refs << obj.reference
  self
end

#clearObject

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.



45
46
47
48
# File 'lib/nanoc/core/outdatedness_store.rb', line 45

def clear
  @outdated_refs = Set.new
  self
end

#empty?Boolean

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.

Returns:

  • (Boolean)


40
41
42
# File 'lib/nanoc/core/outdatedness_store.rb', line 40

def empty?
  @outdated_refs.empty?
end

#include?(obj) ⇒ Boolean

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.

Returns:

  • (Boolean)


23
24
25
# File 'lib/nanoc/core/outdatedness_store.rb', line 23

def include?(obj)
  @outdated_refs.include?(obj.reference)
end

#remove(obj) ⇒ Object

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.



34
35
36
37
# File 'lib/nanoc/core/outdatedness_store.rb', line 34

def remove(obj)
  @outdated_refs.delete(obj.reference)
  self
end