Class: Spree::Core::CurrentStore

Inherits:
Object
  • Object
show all
Defined in:
lib/spree/core/current_store.rb

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ CurrentStore

Returns a new instance of CurrentStore.



7
8
9
# File 'lib/spree/core/current_store.rb', line 7

def initialize(request)
  @request = request
end

Instance Method Details

#storeSpree::Store

Chooses the current store based on a request. Checks request headers for HTTP_SPREE_STORE and falls back to looking up by the requesting server’s name.

Returns:



15
16
17
# File 'lib/spree/core/current_store.rb', line 15

def store
  Spree::Store.current(store_key)
end