Class: ItunesSearch::Search
- Inherits:
-
Object
- Object
- ItunesSearch::Search
- Defined in:
- lib/itunes-search/search.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
Returns the value of attribute json.
-
#options ⇒ Object
Returns the value of attribute options.
-
#result_hash ⇒ Object
Returns the value of attribute result_hash.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Search
constructor
A new instance of Search.
- #results ⇒ Object
Constructor Details
#initialize(*args) ⇒ Search
Returns a new instance of Search.
7 8 9 |
# File 'lib/itunes-search/search.rb', line 7 def initialize(*args) @options = args.inject({}) { |element, result| result.merge(element); result } end |
Instance Attribute Details
#json ⇒ Object
Returns the value of attribute json.
5 6 7 |
# File 'lib/itunes-search/search.rb', line 5 def json @json end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/itunes-search/search.rb', line 5 def @options end |
#result_hash ⇒ Object
Returns the value of attribute result_hash.
5 6 7 |
# File 'lib/itunes-search/search.rb', line 5 def result_hash @result_hash end |
Instance Method Details
#results ⇒ Object
11 12 13 |
# File 'lib/itunes-search/search.rb', line 11 def results to_hash.empty? ? [] : to_hash["results"].collect { |r| OpenStruct.new(r) } end |