Class: Briskly::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/briskly/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stores) ⇒ Scope

Returns a new instance of Scope.



7
8
9
# File 'lib/briskly/scope.rb', line 7

def initialize(stores)
  @stores = stores
end

Instance Attribute Details

#storesObject (readonly)

Returns the value of attribute stores.



5
6
7
# File 'lib/briskly/scope.rb', line 5

def stores
  @stores
end

Instance Method Details

#search(keyword, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/briskly/scope.rb', line 11

def search(keyword, options = {})
  result = {}

  @stores.each do |store|
    result[store.key] = store.search(keyword, options)
  end

  result
end