Sha256: 1b6b02efeac08ae4fc8304ceeed44a31c3f35bf747c664b049592287243da96f
Contents?: true
Size: 566 Bytes
Versions: 15
Compression:
Stored size: 566 Bytes
Contents
module Asynchronic module DataStore class Key < String SEPARATOR = '|' def initialize(key) super key.to_s end def [](key) self.class.new [self,key].join(SEPARATOR) end def sections split SEPARATOR end def nested? sections.count > 1 end def remove_first(count=1) self.class.new sections[count..-1].join(SEPARATOR) end def remove_last(count=1) self.class.new sections[0..-count-1].join(SEPARATOR) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems