Class: Typed::Changes

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

Instance Method Summary collapse

Constructor Details

#initializeChanges

Returns a new instance of Changes.



3
4
5
# File 'lib/typed/changes.rb', line 3

def initialize
  @hash = {}
end

Instance Method Details

#keysObject



15
16
17
# File 'lib/typed/changes.rb', line 15

def keys
  @hash.to_a.sort_by(&:last).map(&:first)
end

#resetObject



7
8
9
# File 'lib/typed/changes.rb', line 7

def reset
  @hash = {}
end

#touch(key) ⇒ Object



11
12
13
# File 'lib/typed/changes.rb', line 11

def touch(key)
  @hash[key.to_s] = Time.now
end