Module: Rico

Defined in:
lib/rico.rb,
lib/rico/map.rb,
lib/rico/set.rb,
lib/rico/list.rb,
lib/rico/array.rb,
lib/rico/value.rb,
lib/rico/object.rb,
lib/rico/counter.rb,
lib/rico/version.rb,
lib/rico/resolver.rb,
lib/rico/collection.rb,
lib/rico/sorted_map.rb,
lib/rico/sorted_set.rb,
lib/rico/capped_sorted_map.rb

Defined Under Namespace

Modules: Object Classes: Array, CappedSortedMap, Collection, Counter, List, Map, Resolver, Set, SortedMap, SortedSet, Value

Constant Summary collapse

TYPES =
{
  "Array" => "array",
  "List" => "list",
  "SortedSet" => "sset",
  "Set" => "set",
  "Map" => "map",
  "SortedMap" => "smap",
  "CappedSortedMap" => "csmap",
  "Value" => "value"
}
VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.bucket(key) ⇒ Object



38
39
40
41
42
# File 'lib/rico.rb', line 38

def self.bucket(key)
  namespaced_key = [@namespace, key].flatten.select(&:present?).join(":")
  @bucket_cache ||= {}
  @bucket_cache[namespaced_key] ||= riak.bucket(namespaced_key)
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Rico)

    the object that the method was called on



34
35
36
# File 'lib/rico.rb', line 34

def self.configure
  yield self if block_given?
end

.namespaceObject



44
45
46
# File 'lib/rico.rb', line 44

def self.namespace
  @namespace
end

.namespace=(namespace) ⇒ Object



48
49
50
# File 'lib/rico.rb', line 48

def self.namespace=(namespace)
  @namespace = namespace
end

.optionsObject



52
53
54
# File 'lib/rico.rb', line 52

def self.options
  @options || {}
end

.options=(options) ⇒ Object



56
57
58
# File 'lib/rico.rb', line 56

def self.options=(options)
  @options = options
end

.riakObject



60
61
62
# File 'lib/rico.rb', line 60

def self.riak
  Thread.current[:riak] ||= Riak::Client.new(options)
end