Class: DryHamlHandlebars::ContentCache

Inherits:
Object
  • Object
show all
Defined in:
lib/dry_haml_handlebars.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContentCache

Returns a new instance of ContentCache.



46
47
48
# File 'lib/dry_haml_handlebars.rb', line 46

def initialize
  @store = []
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



44
45
46
# File 'lib/dry_haml_handlebars.rb', line 44

def index
  @index
end

#storeObject

Returns the value of attribute store.



44
45
46
# File 'lib/dry_haml_handlebars.rb', line 44

def store
  @store
end

Instance Method Details

#add_item(name, path) ⇒ Object



50
51
52
53
# File 'lib/dry_haml_handlebars.rb', line 50

def add_item(name, path)
  item   = ContentItem.new(name.to_sym, path.to_s)
  @store << item
end

#clearObject



59
60
61
# File 'lib/dry_haml_handlebars.rb', line 59

def clear
  initialize
end

#remove_item(item) ⇒ Object



55
56
57
# File 'lib/dry_haml_handlebars.rb', line 55

def remove_item(item)
  @store.delete item
end