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
# File 'lib/nanoc/core/outdatedness_store.rb', line 10

def initialize(config:)
  super(Nanoc::Core::Store.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.



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

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.



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

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)


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

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)


17
18
19
# File 'lib/nanoc/core/outdatedness_store.rb', line 17

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.



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

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