Sha256: 681ea33edda70ca6bea922c13290b4771ae00630fbb71678be45839557991359

Contents?: true

Size: 537 Bytes

Versions: 2

Compression:

Stored size: 537 Bytes

Contents

require "flex_station_data/presenters/plate_hash"

module FlexStationData
  module Presenters
    class PlatesHash
      include Concerns::Presenter

      attr_reader :file, :plates, :options

      def initialize(file, plates, **options)
        @file = file
        @plates = plates
        @options = options
      end

      def present
        base = { "file" => file.basename.to_s }
        plates.flat_map do |plate|
          PlateHash.present(plate, **options).map(&base.method(:merge))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flex-station-data-1.0.1 lib/flex_station_data/presenters/plates_hash.rb
flex-station-data-1.0.0 lib/flex_station_data/presenters/plates_hash.rb