Sha256: a1fc59c2e975481d796919fd426b8b0fc85f1352ac983638afd002ab9c1c6e4d

Contents?: true

Size: 247 Bytes

Versions: 2

Compression:

Stored size: 247 Bytes

Contents

module PluckMap
  module Struct
    module ClassMethods
      def presenter
        @presenter || superclass.presenter
      end

      def load(relation)
        presenter.to_h(relation).map { |values| new(**values) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pluck_map-2.0.0 lib/pluck_map/struct.rb
pluck_map-2.0.0.rc1 lib/pluck_map/struct.rb