Sha256: c073ef5479ffc88f815dd5e795a5f49cdc9407663707bc70f1138d16acb28448

Contents?: true

Size: 624 Bytes

Versions: 12

Compression:

Stored size: 624 Bytes

Contents

module Gdshowsdb
  class SetYAMLParser
    def self.from_yaml(year)
      SetYAMLParser.new(Gdshowsdb.load_yaml_for_year(year))
    end

    def initialize(show_list)
      @show_list = show_list
    end

    def parse      
      parsed_sets = []
      
      @show_list.each do |show_date, show| 
        sets = show[:sets]
        if sets && !sets.empty?
          sets.each_with_index do |set, i|
            parsed_sets.push(
              {uuid: set[:uuid], show_uuid: show[:uuid], position: i, encore: ShowSet.encore?(sets, set)}
            )
          end
        end
      end

      parsed_sets
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gdshowsdb-4.0.2 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-4.0.1 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-4.0.0 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-3.0.0 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-2.1.0 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-2.0.0 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-1.0.3 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-1.0.2 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-1.0.1 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-1.0.0 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-0.9.1 lib/gdshowsdb/set_yaml_parser.rb
gdshowsdb-0.9.0 lib/gdshowsdb/set_yaml_parser.rb