Sha256: 9a2786eb8770b6ecfb612ed4bf9b84821b57e63160cb7cfc855b1920c78ce180

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module CloudSesame
	module Domain
		module ClientModule
			module Caching
				class Base

					def initialize(searchable, &lazy_client)
						@searchable = searchable
						@lazy_client = lazy_client
					end

					def client
						@client ||= @lazy_client.call
					end

					def fetch(_params)
						raise Error::Caching, "Caching Module needs #fetch method and accepts params"
					end

					private

					def search(params)
						client.search params
					end

				end
			end
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
CloudSesame-0.6.8 lib/cloud_sesame/domain/client_module/caching/base.rb
CloudSesame-0.6.7 lib/cloud_sesame/domain/client_module/caching/base.rb
CloudSesame-0.6.6 lib/cloud_sesame/domain/client_module/caching/base.rb