Class: MasterView::MTimeTrackingHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/masterview/mtime_tracking_hash.rb

Overview

this hash is designed to track modified times of its values this behaviour is only supported through using []= and store mechanisms and thus default semantics have been excluded other update methods such as merge! have been excluded from this implementation and will raise errors

Instance Method Summary collapse

Constructor Details

#initializeMTimeTrackingHash

MTimeTrackingHash does not support defaults and thus does not take default object or block



12
13
14
15
# File 'lib/masterview/mtime_tracking_hash.rb', line 12

def initialize
  super
  @mtimes = {}
end

Instance Method Details

#[]=(key, value) ⇒ Object



17
18
19
20
# File 'lib/masterview/mtime_tracking_hash.rb', line 17

def []=(key, value)
  update_mtime(key)
  super
end

#delete(key) ⇒ Object



27
28
29
30
# File 'lib/masterview/mtime_tracking_hash.rb', line 27

def delete(key)
  delete_mtime(key)
  super
end

#mtime(key) ⇒ Object

returns the Time object for this key



33
34
35
# File 'lib/masterview/mtime_tracking_hash.rb', line 33

def mtime(key)
  @mtimes[key]
end

#store(key, value) ⇒ Object



22
23
24
25
# File 'lib/masterview/mtime_tracking_hash.rb', line 22

def store(key, value)
  update_mtime(key)
  super
end