Sha256: 67760ce942fdab87bf4ee900a1ab8d84ef680feec5f118a2faab66e6549c7144
Contents?: true
Size: 485 Bytes
Versions: 3
Compression:
Stored size: 485 Bytes
Contents
# encoding: utf-8 module Virginia class DocumentCache class Document < Struct.new(:id, :body, :content_type, :lifetime, :created_at, :expires_at) def initialize(id, body, content_type = 'text/plain', lifetime = nil) self.id, self.body, self.content_type, self.lifetime = id, body, content_type, lifetime self.created_at = Time.now if self.lifetime self.expires_at = self.created_at + self.lifetime end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
virginia-0.5.2 | lib/virginia/document_cache/document.rb |
virginia-0.5.1 | lib/virginia/document_cache/document.rb |
virginia-0.5.0 | lib/virginia/document_cache/document.rb |