Class: DataMapper::Query::Direction
- Inherits:
-
Object
- Object
- DataMapper::Query::Direction
- Includes:
- Assertions
- Defined in:
- lib/dm-core/query.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
- #inspect ⇒ Object
- #reverse ⇒ Object
Methods included from Assertions
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
565 566 567 |
# File 'lib/dm-core/query.rb', line 565 def direction @direction end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
565 566 567 |
# File 'lib/dm-core/query.rb', line 565 def property @property end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
567 568 569 570 |
# File 'lib/dm-core/query.rb', line 567 def ==(other) return true if super hash == other.hash end |
#hash ⇒ Object
574 575 576 |
# File 'lib/dm-core/query.rb', line 574 def hash @property.hash + @direction.hash end |
#inspect ⇒ Object
582 583 584 |
# File 'lib/dm-core/query.rb', line 582 def inspect "#<#{self.class.name} #{@property.inspect} #{@direction}>" end |
#reverse ⇒ Object
578 579 580 |
# File 'lib/dm-core/query.rb', line 578 def reverse self.class.new(@property, @direction == :asc ? :desc : :asc) end |