Class: GetStream::Generated::Models::RankingConfig

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/ranking_config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#==, #inspect, omit_empty_fields, #to_h, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ RankingConfig

Initialize with attributes



35
36
37
38
39
40
41
42
43
44
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 35

def initialize(attributes = {})
  super(attributes)
  @type = attributes.fetch(:type) { attributes.fetch('type', nil) }
  @exclude_below = attributes.fetch(:exclude_below) { attributes.fetch('exclude_below', nil) }
  @score = attributes.fetch(:score) { attributes.fetch('score', nil) }
  @arrange = attributes.fetch(:arrange) { attributes.fetch('arrange', nil) }
  @defaults = attributes.fetch(:defaults) { attributes.fetch('defaults', nil) }
  @for_you = attributes.fetch(:for_you) { attributes.fetch('for_you', nil) }
  @functions = attributes.fetch(:functions) { attributes.fetch('functions', nil) }
end

Instance Attribute Details

#arrange ⇒ ArrangeConfig

Returns:



23
24
25
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 23

def arrange
  @arrange
end

#defaults ⇒ Object

Returns Default values for ranking.

Returns:

  • (Object) —

    Default values for ranking



26
27
28
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 26

def defaults
  @defaults
end

#exclude_below ⇒ Float

Returns Activities scoring strictly below this value are dropped from the ranked feed. Not supported on aggregated feeds.

Returns:

  • (Float) —

    Activities scoring strictly below this value are dropped from the ranked feed. Not supported on aggregated feeds



17
18
19
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 17

def exclude_below
  @exclude_below
end

#for_you ⇒ ForYouConfig

Returns:



29
30
31
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 29

def for_you
  @for_you
end

#functions ⇒ Hash<String, DecayFunctionConfig>

Returns Decay functions configuration.

Returns:



32
33
34
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 32

def functions
  @functions
end

#score ⇒ String

Returns Scoring formula. Required when type is 'expression' (unless for_you.preset is set) or 'interest'.

Returns:

  • (String) —

    Scoring formula. Required when type is 'expression' (unless for_you.preset is set) or 'interest'



20
21
22
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 20

def score
  @score
end

#type ⇒ String

Returns Type of ranking algorithm. Required. One of: expression, interest.

Returns:

  • (String) —

    Type of ranking algorithm. Required. One of: expression, interest



14
15
16
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 14

def type
  @type
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/getstream_ruby/generated/models/ranking_config.rb', line 47

def self.json_field_mappings
  {
    type: 'type',
    exclude_below: 'exclude_below',
    score: 'score',
    arrange: 'arrange',
    defaults: 'defaults',
    for_you: 'for_you',
    functions: 'functions'
  }
end