Class: Stew::Store::SalesClient

Inherits:
Object
  • Object
show all
Defined in:
lib/stew/store/sales_client.rb

Overview

Creation of sales objects

Constant Summary collapse

STORE_URL =
'http://store.steampowered.com'

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ SalesClient

Returns a new instance of SalesClient.



7
8
9
# File 'lib/stew/store/sales_client.rb', line 7

def initialize(opts = {})
  @client = opts[:client] || Stew.config[:default_web_client].new(STORE_URL)
end

Instance Method Details

#sales(region = Stew.config[:default_region]) ⇒ Object



11
12
13
# File 'lib/stew/store/sales_client.rb', line 11

def sales(region = Stew.config[:default_region])
  Sales.new(@client.get("/search/tab",{:cc => region, :l => 'english', :tab => 'Discounts', :start => 0, :count => 10000}))
end