Class: Redis::Commands::Search::Desc

Inherits:
Object
  • Object
show all
Defined in:
lib/redis/commands/modules/search/aggregation.rb

Overview

Wraps a field name with a descending (+DESC+) sort order for AggregateRequest#sort_by.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Desc

Returns a new instance of Desc.

Parameters:

  • name (String)

    the field name to sort descending



180
181
182
183
# File 'lib/redis/commands/modules/search/aggregation.rb', line 180

def initialize(name)
  @name = name
  @order = 'DESC'
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)

    the field name

  • (String)

    the order keyword, always "DESC"



177
178
179
# File 'lib/redis/commands/modules/search/aggregation.rb', line 177

def name
  @name
end

#orderString (readonly)

Returns:

  • (String)

    the field name

  • (String)

    the order keyword, always "DESC"



177
178
179
# File 'lib/redis/commands/modules/search/aggregation.rb', line 177

def order
  @order
end