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.



16897
16898
16899
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16897

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)


16889
16890
16891
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16889

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)


16895
16896
16897
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16895

def secondary
  @secondary
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



16902
16903
16904
16905
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16902

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