Sha256: 01ae5181437028109578a8cbb03e2fbcef97caee5e38a57979e8e93b0668d75d

Contents?: true

Size: 662 Bytes

Versions: 5

Compression:

Stored size: 662 Bytes

Contents

module Songkickr
  class ConcertSetlistResult
    attr_accessor :results
    
    def initialize(result_hash = {})
      
      if result_hash["resultsPage"]
        results_page = result_hash["resultsPage"]
      
        if results_page
          @results = parse_results results_page["results"]
        end
      else
        result_hash
      end
    end
    
    
    protected
    
      def parse_results(results = {})
        setlists = []
        if results.include?("setlist")
          results["setlist"].each do |setlist|
            setlists << Songkickr::Setlist.new(setlist)
          end
        end
        
        setlists
      end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
songkickr-0.1.4 lib/songkickr/concert_setlist_result.rb
songkickr-0.1.3 lib/songkickr/concert_setlist_result.rb
songkickr-0.1.2 lib/songkickr/concert_setlist_result.rb
songkickr-0.1.1 lib/songkickr/concert_setlist_result.rb
songkickr-0.1.0 lib/songkickr/concert_setlist_result.rb