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.



16169
16170
16171
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16169

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)


16161
16162
16163
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16161

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)


16167
16168
16169
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16167

def secondary
  @secondary
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



16174
16175
16176
16177
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 16174

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