Class: SteamStoreParser::BaseClient
- Inherits:
-
Object
- Object
- SteamStoreParser::BaseClient
- Defined in:
- lib/steam-store-parser/base-client.rb
Constant Summary collapse
- BASE_URL =
'http://store.steampowered.com/search/?'
- GAMES_ONLY =
to filter games only
'&category1=998'
Instance Method Summary collapse
-
#home_page ⇒ String
The HTML source of the page.
-
#initialize(params) ⇒ BaseClient
constructor
A new instance of BaseClient.
-
#page(page) ⇒ String
Webpage.
Constructor Details
#initialize(params) ⇒ BaseClient
Returns a new instance of BaseClient.
7 8 9 10 |
# File 'lib/steam-store-parser/base-client.rb', line 7 def initialize(params) raise ArgumentError unless params.is_a? Hash @url = build_url(params) end |
Instance Method Details
#home_page ⇒ String
Returns the HTML source of the page.
18 19 20 |
# File 'lib/steam-store-parser/base-client.rb', line 18 def home_page page(1) end |
#page(page) ⇒ String
Returns Webpage.
13 14 15 |
# File 'lib/steam-store-parser/base-client.rb', line 13 def page(page) RestClient.get "#{@url}&page=#{page}" end |