Class: Spree::Core::CurrentStore
- Inherits:
-
Object
- Object
- Spree::Core::CurrentStore
- Defined in:
- lib/spree/core/current_store.rb
Instance Method Summary collapse
-
#initialize(request) ⇒ CurrentStore
constructor
A new instance of CurrentStore.
-
#store ⇒ Spree::Store
Chooses the current store based on a request.
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
#store ⇒ Spree::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.
15 16 17 |
# File 'lib/spree/core/current_store.rb', line 15 def store Spree::Store.current(store_key) end |