Sha256: 72b2f2473fa9b0da705da6883ef1a278158785abf47745e69c1eb94e0f8a059f

Contents?: true

Size: 534 Bytes

Versions: 6

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2023, by Samuel Williams.

module Async
	module Redis
		class Key
			def self.[] path
				self.new(path)
			end
			
			include Comparable
			
			def initialize(path)
				@path = path
			end
			
			def size
				@path.bytesize
			end
			
			attr :path
			
			def to_s
				@path
			end
			
			def to_str
				@path
			end
			
			def [] key
				self.class.new("#{@path}:#{key}")
			end
			
			def <=> other
				@path <=> other.to_str
			end
		end
	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
async-redis-0.11.0 lib/async/redis/key.rb
async-redis-0.10.1 lib/async/redis/key.rb
async-redis-0.10.0 lib/async/redis/key.rb
async-redis-0.9.0 lib/async/redis/key.rb
async-redis-0.8.1 lib/async/redis/key.rb
async-redis-0.8.0 lib/async/redis/key.rb