Class: GetStream::Generated::Models::UserInterestRequest
- 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
-
#tag ⇒ String
The interest tag; trimmed and lower-cased like activity interest_tags.
-
#weight ⇒ Float
Ranking weight between -1.0 (dislike) and 1.0 (like).
Class Method Summary collapse
-
.json_field_mappings ⇒ Object
Override field mappings for JSON serialization.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ UserInterestRequest
constructor
Initialize with attributes.
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.
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.
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 |