module RRRMatey::StringModel::ConnectionMethods
Public Instance Methods
cache_proxy()
click to toggle source
# File lib/rrrmatey/string_model/connection_methods.rb, line 4 def cache_proxy() if @cache_proxy.nil? && self.name != RRRMatey::StringModel.name return StringModel.cache_proxy end @cache_proxy end
cache_proxy=(v)
click to toggle source
# File lib/rrrmatey/string_model/connection_methods.rb, line 11 def cache_proxy=(v) @cache_proxy = v end
riak()
click to toggle source
# File lib/rrrmatey/string_model/connection_methods.rb, line 15 def riak() if @riak.nil? && self.name != RRRMatey::StringModel.name return StringModel.riak end @riak end
riak=(v)
click to toggle source
# File lib/rrrmatey/string_model/connection_methods.rb, line 22 def riak=(v) @riak = v unless @riak.nil? ensure_search_index() end @riak end
Private Instance Methods
ensure_search_index()
click to toggle source
# File lib/rrrmatey/string_model/connection_methods.rb, line 32 def ensure_search_index() return unless respond_to_index_name? bucket = riak.with { |r| r.create_search_index(index_name, '_yz_default') r.bucket(namespace) } bucket.properties = { 'search_index' => index_name } end
respond_to_index_name?()
click to toggle source
# File lib/rrrmatey/string_model/connection_methods.rb, line 41 def respond_to_index_name?() @respond_to_index_name ||= respond_to?(:index_name) end