Class: Nanoc3::Helpers::Capturing::CapturesStore Private

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/nanoc3/helpers/capturing.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 Method Summary collapse

Constructor Details

#initializeCapturesStore

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 CapturesStore.



45
46
47
# File 'lib/nanoc3/helpers/capturing.rb', line 45

def initialize
  @store = {}
end

Instance Method Details

#[](item, name) ⇒ 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.



54
55
56
57
# File 'lib/nanoc3/helpers/capturing.rb', line 54

def [](item, name)
  @store[item.identifier] ||= {}
  @store[item.identifier][name]
end

#[]=(item, name, content) ⇒ 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.



49
50
51
52
# File 'lib/nanoc3/helpers/capturing.rb', line 49

def []=(item, name, content)
  @store[item.identifier] ||= {}
  @store[item.identifier][name] = content
end