Class: Disposable::Twin::Changed::Changes

Inherits:
Hash
  • Object
show all
Defined in:
lib/disposable/twin/changed.rb

Instance Method Summary collapse

Instance Method Details

#changed?(name = nil) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
# File 'lib/disposable/twin/changed.rb', line 3

def changed?(name=nil)
  return true if name.nil? and values.find { |val| val == true } # TODO: this could be speed-improved, of course.

  !! self[name.to_s]
end