Module: GathererSetParser::QueryString

Included in:
Fetch
Defined in:
lib/gatherer_set_parser/query_string.rb

Instance Method Summary collapse

Instance Method Details

#escaped_setObject



8
9
10
# File 'lib/gatherer_set_parser/query_string.rb', line 8

def escaped_set
  @query_string ||= URI.escape set_name
end

#gatherer_url(page) ⇒ Object



20
21
22
# File 'lib/gatherer_set_parser/query_string.rb', line 20

def gatherer_url page
  url + query_string + "&page=#{page}"
end

#initialize(set) ⇒ Object



4
5
6
# File 'lib/gatherer_set_parser/query_string.rb', line 4

def initialize set
  @set_name = set
end

#query_stringObject



12
13
14
# File 'lib/gatherer_set_parser/query_string.rb', line 12

def query_string
  "output=standard&set=[%22#{escaped_set}%22]"
end

#urlObject



16
17
18
# File 'lib/gatherer_set_parser/query_string.rb', line 16

def url
  "http://gatherer.wizards.com/Pages/Search/Default.aspx?"
end