Class: ZQuickblox::Dialog::Dialog
- Inherits:
-
Object
- Object
- ZQuickblox::Dialog::Dialog
- Defined in:
- lib/zquickblox/dialog.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_message ⇒ Object
Returns the value of attribute last_message.
-
#last_message_date_sent ⇒ Object
Returns the value of attribute last_message_date_sent.
-
#last_message_user_id ⇒ Object
Returns the value of attribute last_message_user_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#occupants_ids ⇒ Object
Returns the value of attribute occupants_ids.
-
#photo ⇒ Object
Returns the value of attribute photo.
-
#type ⇒ Object
Returns the value of attribute type.
-
#unread_messages_count ⇒ Object
Returns the value of attribute unread_messages_count.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
- #build_params ⇒ Object
- #build_update_params ⇒ Object
-
#initialize(params) ⇒ Dialog
constructor
A new instance of Dialog.
Constructor Details
#initialize(params) ⇒ Dialog
Returns a new instance of Dialog.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/zquickblox/dialog.rb', line 50 def initialize(params) @id = params[:_id] @user_id = params[:user_id] @type = params[:type] @occupants_ids = params[:occupants_ids] @name = params[:name] @photo = params[:photo] @created_at = params[:created_at] @last_message = params[:last_message] @last_message_date_sent = params[:last_message_date_sent] @last_message_user_id = params[:last_message_user_id] @unread_messages_count = params[:unread_messages_count] end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def id @id end |
#last_message ⇒ Object
Returns the value of attribute last_message.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def @last_message end |
#last_message_date_sent ⇒ Object
Returns the value of attribute last_message_date_sent.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def @last_message_date_sent end |
#last_message_user_id ⇒ Object
Returns the value of attribute last_message_user_id.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def @last_message_user_id end |
#name ⇒ Object
Returns the value of attribute name.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def name @name end |
#occupants_ids ⇒ Object
Returns the value of attribute occupants_ids.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def occupants_ids @occupants_ids end |
#photo ⇒ Object
Returns the value of attribute photo.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def photo @photo end |
#type ⇒ Object
Returns the value of attribute type.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def type @type end |
#unread_messages_count ⇒ Object
Returns the value of attribute unread_messages_count.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def @unread_messages_count end |
#user_id ⇒ Object
Returns the value of attribute user_id.
45 46 47 |
# File 'lib/zquickblox/dialog.rb', line 45 def user_id @user_id end |
Instance Method Details
#build_params ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/zquickblox/dialog.rb', line 64 def build_params { "type": @type, "occupants_ids": @occupants_ids, "name": @name, "photo": @photo } end |
#build_update_params ⇒ Object
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/zquickblox/dialog.rb', line 73 def build_update_params { "type": @type, "push_all": { "occupants_ids": @occupants_ids }, "name": @name, "photo": @photo } end |