class Asynchronic::DataStore::Key

Constants

SEPARATOR

Public Class Methods

[](key) click to toggle source
# File lib/asynchronic/data_store/key.rb, line 7
def self.[](key)
  new key
end
new(key) click to toggle source
Calls superclass method
# File lib/asynchronic/data_store/key.rb, line 11
def initialize(key)
  super key.to_s
end

Public Instance Methods

[](key) click to toggle source
# File lib/asynchronic/data_store/key.rb, line 15
def [](key)
  self.class.new [self, key].join(SEPARATOR)
end
nested?() click to toggle source
# File lib/asynchronic/data_store/key.rb, line 23
def nested?
  sections.count > 1
end
remove_first(count=1) click to toggle source
# File lib/asynchronic/data_store/key.rb, line 27
def remove_first(count=1)
  self.class.new sections[count..-1].join(SEPARATOR)
end
remove_last(count=1) click to toggle source
# File lib/asynchronic/data_store/key.rb, line 31
def remove_last(count=1)
  self.class.new sections[0..-count-1].join(SEPARATOR)
end
sections() click to toggle source
# File lib/asynchronic/data_store/key.rb, line 19
def sections
  split SEPARATOR
end