Class: GetStream::Generated::Models::PollVote

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/getstream_ruby/generated/models/poll_vote.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 = {}) ⇒ PollVote

Initialize with attributes



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/getstream_ruby/generated/models/poll_vote.rb', line 41

def initialize(attributes = {})
  super(attributes)
  @created_at = attributes[:created_at] || attributes['created_at']
  @id = attributes[:id] || attributes['id']
  @option_id = attributes[:option_id] || attributes['option_id']
  @poll_id = attributes[:poll_id] || attributes['poll_id']
  @updated_at = attributes[:updated_at] || attributes['updated_at']
  @answer_text = attributes[:answer_text] || attributes['answer_text'] || nil
  @is_answer = attributes[:is_answer] || attributes['is_answer'] || nil
  @user_id = attributes[:user_id] || attributes['user_id'] || nil
  @user = attributes[:user] || attributes['user'] || nil
end

Instance Attribute Details

#answer_textString

Returns:

  • (String)


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

def answer_text
  @answer_text
end

#created_atDateTime

Returns:

  • (DateTime)


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

def created_at
  @created_at
end

#idString

Returns:

  • (String)


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

def id
  @id
end

#is_answerBoolean

Returns:

  • (Boolean)


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

def is_answer
  @is_answer
end

#option_idString

Returns:

  • (String)


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

def option_id
  @option_id
end

#poll_idString

Returns:

  • (String)


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

def poll_id
  @poll_id
end

#updated_atDateTime

Returns:

  • (DateTime)


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

def updated_at
  @updated_at
end

#userUser

Returns:



38
39
40
# File 'lib/getstream_ruby/generated/models/poll_vote.rb', line 38

def user
  @user
end

#user_idString

Returns:

  • (String)


35
36
37
# File 'lib/getstream_ruby/generated/models/poll_vote.rb', line 35

def user_id
  @user_id
end

Class Method Details

.json_field_mappingsObject

Override field mappings for JSON serialization



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/getstream_ruby/generated/models/poll_vote.rb', line 55

def self.json_field_mappings
  {
    created_at: 'created_at',
    id: 'id',
    option_id: 'option_id',
    poll_id: 'poll_id',
    updated_at: 'updated_at',
    answer_text: 'answer_text',
    is_answer: 'is_answer',
    user_id: 'user_id',
    user: 'user'
  }
end