Class: SynCache::Placeholder

Inherits:
Object
  • Object
show all
Defined in:
lib/syncache/remote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlaceholder

Returns a new instance of Placeholder.



21
22
23
24
# File 'lib/syncache/remote.rb', line 21

def initialize
  @id = rand(9223372036854775808)
  @timestamp = Time.now
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



26
27
28
# File 'lib/syncache/remote.rb', line 26

def id
  @id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



26
27
28
# File 'lib/syncache/remote.rb', line 26

def timestamp
  @timestamp
end

Instance Method Details

#===(other) ⇒ Object



28
29
30
# File 'lib/syncache/remote.rb', line 28

def ===(other)
  other.kind_of?(Placeholder) and other.id == @id
end