Class: DataMapper::Query::Direction

Inherits:
Operator show all
Extended by:
Deprecate
Defined in:
lib/dm-core/query/direction.rb

Instance Attribute Summary

Attributes inherited from Operator

#operator, #target

Instance Method Summary collapse

Methods included from Deprecate

deprecate

Methods inherited from Operator

#inspect

Methods included from Equalizer

#equalize

Methods included from Assertions

#assert_kind_of

Instance Method Details

#get(resource) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/dm-core/query/direction.rb', line 28

def get(resource)
  Sort.new(target.get(resource), @operator == :asc)
end

#reverse!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
# File 'lib/dm-core/query/direction.rb', line 22

def reverse!
  @operator = @operator == :asc ? :desc : :asc
  self
end