Sha256: e52b8d721d74edadace1052e92b248fa3528c17780afd741014f482e3d793d7c
Contents?: true
Size: 616 Bytes
Versions: 13
Compression:
Stored size: 616 Bytes
Contents
module Asynchronic module DataStore class Key < String SEPARATOR = '|' def self.[](key) new key end 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
13 entries across 13 versions & 1 rubygems