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.
514 515 516 |
# File 'lib/dm-core/query.rb', line 514 def direction @direction end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
514 515 516 |
# File 'lib/dm-core/query.rb', line 514 def property @property end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
516 517 518 519 |
# File 'lib/dm-core/query.rb', line 516 def ==(other) return true if super hash == other.hash end |
#hash ⇒ Object
523 524 525 |
# File 'lib/dm-core/query.rb', line 523 def hash @property.hash + @direction.hash end |
#inspect ⇒ Object
531 532 533 |
# File 'lib/dm-core/query.rb', line 531 def inspect "#<#{self.class.name} #{@property.inspect} #{@direction}>" end |
#reverse ⇒ Object
527 528 529 |
# File 'lib/dm-core/query.rb', line 527 def reverse self.class.new(@property, @direction == :asc ? :desc : :asc) end |