Class: DataMapper::Query::Direction
- Includes:
- Assertions
- Defined in:
- lib/gems/dm-core-0.9.7/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.
517 518 519 |
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/query.rb', line 517 def direction @direction end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
517 518 519 |
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/query.rb', line 517 def property @property end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
519 520 521 522 |
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/query.rb', line 519 def ==(other) return true if super hash == other.hash end |
#hash ⇒ Object
526 527 528 |
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/query.rb', line 526 def hash @property.hash + @direction.hash end |
#inspect ⇒ Object
534 535 536 |
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/query.rb', line 534 def inspect "#<#{self.class.name} #{@property.inspect} #{@direction}>" end |
#reverse ⇒ Object
530 531 532 |
# File 'lib/gems/dm-core-0.9.7/lib/dm-core/query.rb', line 530 def reverse self.class.new(@property, @direction == :asc ? :desc : :asc) end |