Class: GroceryList::IGASearcher
- Inherits:
-
AbstractSearcher
- Object
- AbstractSearcher
- GroceryList::IGASearcher
- Defined in:
- lib/grocery_list/item_searchers/iga_item_searcher.rb
Constant Summary collapse
- @@search_url =
"http://magasin.iga.net/Search/BasicSearch.aspx?Search="
- @@valid_options =
[ :priceDesc, :priceAsc, :DisplayNameDesc, :DisplayNameAsc, ]
Instance Attribute Summary collapse
-
#search_options ⇒ Object
Returns the value of attribute search_options.
Instance Method Summary collapse
-
#initialize(search_option = :priceAsc) ⇒ IGASearcher
constructor
A new instance of IGASearcher.
- #search(item) ⇒ Object
Constructor Details
#initialize(search_option = :priceAsc) ⇒ IGASearcher
Returns a new instance of IGASearcher.
17 18 19 |
# File 'lib/grocery_list/item_searchers/iga_item_searcher.rb', line 17 def initialize(search_option = :priceAsc) @search_options = search_option end |
Instance Attribute Details
#search_options ⇒ Object
Returns the value of attribute search_options.
6 7 8 |
# File 'lib/grocery_list/item_searchers/iga_item_searcher.rb', line 6 def @search_options end |
Instance Method Details
#search(item) ⇒ Object
21 22 23 24 |
# File 'lib/grocery_list/item_searchers/iga_item_searcher.rb', line 21 def search(item) raise ArgumentError, "#{item} isn't an Item" unless item.is_a? Item Launchy.open url(item.item_name) end |