Sha256: 383ecfba0575f9a9d582b0ecbaf7a08c6fccbcb20e7c155001a1b11336252d48

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

module Veritas
  class Attribute

    # A mixin for attributes that have orderable values
    module Orderable

      # Sort the attribute in ascending order
      #
      # @example
      #   ascending = attribute.asc
      #
      # @return [Relation::Operation::Order::Ascending]
      #
      # @api public
      def asc
        Relation::Operation::Order::Ascending.new(self)
      end

      # Sort the attribute in descending order
      #
      # @example
      #   descending = attribute.desc
      #
      # @return [Relation::Operation::Order::Descending]
      #
      # @api public
      def desc
        Relation::Operation::Order::Descending.new(self)
      end

    end # module Orderable
  end #class Attribute
end # module Veritas

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-0.0.3 lib/veritas/attribute/orderable.rb
veritas-0.0.2 lib/veritas/attribute/orderable.rb
veritas-0.0.1 lib/veritas/attribute/orderable.rb