Class: MessageMediaConversations::MessageDto
- Defined in:
- lib/message_media_conversations/models/message_dto.rb
Overview
MessageDto Model.
Instance Attribute Summary collapse
-
#channel ⇒ String
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#text ⇒ String
TODO: Write general description for this method.
-
#timestamp ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(channel = nil, id = nil, text = nil, timestamp = nil) ⇒ MessageDto
constructor
A new instance of MessageDto.
Methods inherited from BaseModel
Constructor Details
#initialize(channel = nil, id = nil, text = nil, timestamp = nil) ⇒ MessageDto
Returns a new instance of MessageDto.
33 34 35 36 37 38 39 40 41 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 33 def initialize(channel = nil, id = nil, text = nil, = nil) @channel = channel @id = id @text = text @timestamp = end |
Instance Attribute Details
#channel ⇒ String
TODO: Write general description for this method
9 10 11 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 9 def channel @channel end |
#id ⇒ String
TODO: Write general description for this method
13 14 15 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 13 def id @id end |
#text ⇒ String
TODO: Write general description for this method
17 18 19 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 17 def text @text end |
#timestamp ⇒ String
TODO: Write general description for this method
21 22 23 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 21 def @timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 44 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. channel = hash['channel'] id = hash['id'] text = hash['text'] = hash['timestamp'] # Create object from extracted values. MessageDto.new(channel, id, text, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 30 31 |
# File 'lib/message_media_conversations/models/message_dto.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['channel'] = 'channel' @_hash['id'] = 'id' @_hash['text'] = 'text' @_hash['timestamp'] = 'timestamp' @_hash end |