Sha256: 0f619aba03417e0fdb54038546cac60a96acce2da9d24691be3bcc0788691a76

Contents?: true

Size: 569 Bytes

Versions: 13

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

module Nanoc::Int
  class AggregateDataSource < Nanoc::DataSource
    def initialize(data_sources, config)
      super({}, '/', '/', {})

      @data_sources = data_sources
      @config = config
    end

    def items
      @_items ||= begin
        objs = @data_sources.flat_map(&:items)
        Nanoc::Int::ItemCollection.new(@config, objs)
      end
    end

    def layouts
      @_layouts ||= begin
        objs = @data_sources.flat_map(&:layouts)
        Nanoc::Int::LayoutCollection.new(@config, objs)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
nanoc-4.8.10 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.9 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.8 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.7 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.6 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.5 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.4 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.3 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.2 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.1 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.8.0 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.7.14 lib/nanoc/base/repos/aggregate_data_source.rb
nanoc-4.7.13 lib/nanoc/base/repos/aggregate_data_source.rb