Class: CacheStache::Configuration::KeyspaceBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/cache_stache/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(keyspace) ⇒ KeyspaceBuilder

Returns a new instance of KeyspaceBuilder.



110
111
112
# File 'lib/cache_stache/configuration.rb', line 110

def initialize(keyspace)
  @keyspace = keyspace
end

Instance Method Details

#label(value) ⇒ Object



114
115
116
# File 'lib/cache_stache/configuration.rb', line 114

def label(value)
  @keyspace.label = value
end

#match(regex) ⇒ Object

Raises:



118
119
120
121
# File 'lib/cache_stache/configuration.rb', line 118

def match(regex)
  raise Error, "match requires a Regexp argument, got #{regex.class}" unless regex.is_a?(Regexp)
  @keyspace.pattern = regex
end