Class: Reckless::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/reckless/client.rb

Constant Summary collapse

BASE_URL =
"http://www.reckless.com"

Instance Method Summary collapse

Instance Method Details

#recent_arrivals(options = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/reckless/client.rb', line 16

def recent_arrivals(options = {})
  url = "#{BASE_URL}/new_arrivals.php"

  params = search_options(options).merge(
    period: options[:period] || 1,
    style:  options[:style]  || 0
  )

  Reckless::Search.new(url, params)
end

#search(keywords = "", options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/reckless/client.rb', line 5

def search(keywords = "", options = {})
  url = "#{BASE_URL}/index.php"

  params = search_options(options).merge(
    keywords: keywords,
    is_search: true
  )

  Reckless::Search.new(url, params)
end