Class: Google::Apis::CloudsearchV1::Rank

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudsearch_v1/classes.rb,
lib/google/apis/cloudsearch_v1/representations.rb,
lib/google/apis/cloudsearch_v1/representations.rb

Overview

The rank contains a tuple of numbers which may be used as a general sort order. The rank should be treated as an ordered set of numbers, where the ordering is done in descending order of the most significant rank member. For example, given the following ranks described as (primary, secondary): (1,1), (1,2), (2, 2) (2,1) The descending rank-order is: (2,2) > (2,1) > (1,2) > (1,1)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Rank

Returns a new instance of Rank.



16801
16802
16803
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16801

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#primaryFixnum

The primary rank is the most significant rank member. This rank element should always be present. Items with higher primary rank are always considered of higher rank than those of lower primary rank. Corresponds to the JSON property primary

Returns:

  • (Fixnum)


16793
16794
16795
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16793

def primary
  @primary
end

#secondaryFixnum

The secondary rank may be used to rank items of identical primary rank. This rank element should always be present. Corresponds to the JSON property secondary

Returns:

  • (Fixnum)


16799
16800
16801
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16799

def secondary
  @secondary
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



16806
16807
16808
16809
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16806

def update!(**args)
  @primary = args[:primary] if args.key?(:primary)
  @secondary = args[:secondary] if args.key?(:secondary)
end