Class: TimedCache::Value
Instance Attribute Summary collapse
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#timestamp ⇒ Object
Returns the value of attribute timestamp
2 3 4 |
# File 'lib/tins/timed_cache.rb', line 2 def @timestamp end |
#value ⇒ Object
Returns the value of attribute value
2 3 4 |
# File 'lib/tins/timed_cache.rb', line 2 def value @value end |
Class Method Details
.json_create(hash) ⇒ Object
3 4 5 |
# File 'lib/tins/timed_cache.rb', line 3 def self.json_create(hash) new(*hash.values_at('value', 'timestamp')) end |
Instance Method Details
#as_json ⇒ Object
7 8 9 |
# File 'lib/tins/timed_cache.rb', line 7 def as_json(*) super | { JSON.create_id => self.class.name } end |