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.



333
334
335
# File 'lib/active_mocker/mock/queries.rb', line 333

def initialize(r)
  @r = r
end

Instance Attribute Details

#rObject (readonly)

Returns the value of attribute r.



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

def r
  @r
end

Instance Method Details

#<=>(other) ⇒ Object



337
338
339
# File 'lib/active_mocker/mock/queries.rb', line 337

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