Class: DryHamlHandlebars::ContentCache
- Inherits:
-
Object
- Object
- DryHamlHandlebars::ContentCache
- Defined in:
- lib/dry_haml_handlebars.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
- #add_item(name, path) ⇒ Object
- #clear ⇒ Object
-
#initialize ⇒ ContentCache
constructor
A new instance of ContentCache.
- #remove_item(item) ⇒ Object
Constructor Details
#initialize ⇒ ContentCache
Returns a new instance of ContentCache.
46 47 48 |
# File 'lib/dry_haml_handlebars.rb', line 46 def initialize @store = [] end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
44 45 46 |
# File 'lib/dry_haml_handlebars.rb', line 44 def index @index end |
#store ⇒ Object
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 |
#clear ⇒ Object
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 |