Class: ActiveSupport::Cache::TaggedStore::Dependencies

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/cache/tagged_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(initial) ⇒ Dependencies

Returns a new instance of Dependencies.



12
13
14
# File 'lib/active_support/cache/tagged_store.rb', line 12

def initialize(initial)
  @tags = initial || []
end

Instance Method Details

#<<(tag) ⇒ Object



24
25
26
# File 'lib/active_support/cache/tagged_store.rb', line 24

def <<(tag)
  @tags << tag
end

#concat(*args) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/active_support/cache/tagged_store.rb', line 28

def concat(*args)
  if args.size == 1 && args.first.is_a?(Array)
    @tags.concat(args.first)
  else
    @tags.concat(args)
  end
end

#depends(tag) ⇒ Object



20
21
22
# File 'lib/active_support/cache/tagged_store.rb', line 20

def depends(tag)
  @tags << tag
end

#tagsObject



16
17
18
# File 'lib/active_support/cache/tagged_store.rb', line 16

def tags
  @tags
end