Class: MessageMediaConversations::BaseMessageDto
- Defined in:
- lib/message_media_conversations/models/base_message_dto.rb
Overview
BaseMessageDto Model.
Instance Attribute Summary collapse
-
#channel ⇒ String
TODO: Write general description for this method.
-
#text ⇒ 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(text = nil, channel = nil) ⇒ BaseMessageDto
constructor
A new instance of BaseMessageDto.
Methods inherited from BaseModel
Constructor Details
#initialize(text = nil, channel = nil) ⇒ BaseMessageDto
Returns a new instance of BaseMessageDto.
23 24 25 26 27 |
# File 'lib/message_media_conversations/models/base_message_dto.rb', line 23 def initialize(text = nil, channel = nil) @text = text @channel = channel end |
Instance Attribute Details
#channel ⇒ String
TODO: Write general description for this method
13 14 15 |
# File 'lib/message_media_conversations/models/base_message_dto.rb', line 13 def channel @channel end |
#text ⇒ String
TODO: Write general description for this method
9 10 11 |
# File 'lib/message_media_conversations/models/base_message_dto.rb', line 9 def text @text end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/message_media_conversations/models/base_message_dto.rb', line 30 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. text = hash['text'] channel = hash['channel'] # Create object from extracted values. BaseMessageDto.new(text, channel) end |
.names ⇒ Object
A mapping from model property names to API property names.
16 17 18 19 20 21 |
# File 'lib/message_media_conversations/models/base_message_dto.rb', line 16 def self.names @_hash = {} if @_hash.nil? @_hash['text'] = 'text' @_hash['channel'] = 'channel' @_hash end |