Class: ActiveMocker::Queries::Sort::DESC

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mocker/mock/queries.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(r) ⇒ DESC

Returns a new instance of DESC.



331
332
333
# File 'lib/active_mocker/mock/queries.rb', line 331

def initialize(r)
  @r = r
end

Instance Attribute Details

#rObject (readonly)

Returns the value of attribute r.



329
330
331
# File 'lib/active_mocker/mock/queries.rb', line 329

def r
  @r
end

Instance Method Details

#<=>(other) ⇒ Object



335
336
337
# File 'lib/active_mocker/mock/queries.rb', line 335

def <=>(other)
  -(r <=> other.r) # Flip negative/positive result
end