Class: AppleStoreSearch::Search

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

Overview

Your code goes here…

Instance Method Summary collapse

Constructor Details

#initializeSearch

initialization



7
8
9
10
# File 'lib/apple_store_search.rb', line 7

def initialize
  @base_url="http://itunes.apple.com/search?"
  #@curl = CURL.new
end

Instance Method Details

#search(options, selected) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/apple_store_search.rb', line 12

def search(options,selected)
  @base_url=load_options(options)
  search_parse
  if @data.has_key?('errorMessage')
     puts "Invalid key-value pair(s) in request"
     return
  end
  get_selected(selected)
  return @result
  #puts @data
end