Sha256: a4105171b227572b9f51ad0c0c740fa1d99a732b6c659600ba98ba7e25980bb9

Contents?: true

Size: 562 Bytes

Versions: 1

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

require 'rom/memory/dataset'

module ROM
  module Files
    class Dataset < Memory::Dataset
      module Sorting
        def self.included(other)
          super(other)
          other.module_eval do
            option :sorting, Types::Symbol.optional,
                   default: proc { nil }
          end
        end

        # @!attribute [r] sorting
        #   @return [Symbol, Proc, nil]

        # @return [Dataset]
        def sort(sorting = :to_s)
          with(sorting: sorting)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rom-files-0.2.0 lib/rom/files/dataset/sorting.rb