Class: RPCMapper::Cacheable::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/rpc_mapper/cacheable/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, expire_at) ⇒ Entry

Returns a new instance of Entry.



7
8
9
10
# File 'lib/rpc_mapper/cacheable/entry.rb', line 7

def initialize(value, expire_at)
  self.value = value
  self.expire_at = expire_at
end

Instance Attribute Details

#expire_atObject

Returns the value of attribute expire_at.



5
6
7
# File 'lib/rpc_mapper/cacheable/entry.rb', line 5

def expire_at
  @expire_at
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/rpc_mapper/cacheable/entry.rb', line 5

def value
  @value
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rpc_mapper/cacheable/entry.rb', line 12

def expired?
  Time.now > self.expire_at rescue true
end