Class: GetStream::Generated::Models::UserInterestRequest

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

Overview

An interest tag to set on a user with its ranking weight

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 = {}) ⇒ UserInterestRequest

Initialize with attributes



20
21
22
23
24
# File 'lib/getstream_ruby/generated/models/user_interest_request.rb', line 20

def initialize(attributes = {})
  super(attributes)
  @tag = attributes.fetch(:tag) { attributes.fetch('tag', nil) }
  @weight = attributes.fetch(:weight) { attributes.fetch('weight', nil) }
end

Instance Attribute Details

#tag ⇒ String

Returns The interest tag; trimmed and lower-cased like activity interest_tags. Avoid commas: removing interests takes a comma-separated list, so a tag that contains a comma cannot be removed.

Returns:

  • (String) —

    The interest tag; trimmed and lower-cased like activity interest_tags. Avoid commas: removing interests takes a comma-separated list, so a tag that contains a comma cannot be removed



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

def tag
  @tag
end

#weight ⇒ Float

Returns Ranking weight between -1.0 (dislike) and 1.0 (like). Defaults to 1.0.

Returns:

  • (Float) —

    Ranking weight between -1.0 (dislike) and 1.0 (like). Defaults to 1.0



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

def weight
  @weight
end

Class Method Details

.json_field_mappings ⇒ Object

Override field mappings for JSON serialization



27
28
29
30
31
32
# File 'lib/getstream_ruby/generated/models/user_interest_request.rb', line 27

def self.json_field_mappings
  {
    tag: 'tag',
    weight: 'weight'
  }
end