Class: MessageMediaConversations::AppUsersDto
- Defined in:
- lib/message_media_conversations/models/app_users_dto.rb
Overview
AppUsersDto Model.
Instance Attribute Summary collapse
-
#users ⇒ List of AppUserDto
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(users = nil) ⇒ AppUsersDto
constructor
A new instance of AppUsersDto.
Methods inherited from BaseModel
Constructor Details
#initialize(users = nil) ⇒ AppUsersDto
Returns a new instance of AppUsersDto.
18 19 20 |
# File 'lib/message_media_conversations/models/app_users_dto.rb', line 18 def initialize(users = nil) @users = users end |
Instance Attribute Details
#users ⇒ List of AppUserDto
TODO: Write general description for this method
9 10 11 |
# File 'lib/message_media_conversations/models/app_users_dto.rb', line 9 def users @users end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/message_media_conversations/models/app_users_dto.rb', line 23 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it users = nil unless hash['users'].nil? users = [] hash['users'].each do |structure| users << (AppUserDto.from_hash(structure) if structure) end end # Create object from extracted values. AppUsersDto.new(users) end |
.names ⇒ Object
A mapping from model property names to API property names.
12 13 14 15 16 |
# File 'lib/message_media_conversations/models/app_users_dto.rb', line 12 def self.names @_hash = {} if @_hash.nil? @_hash['users'] = 'users' @_hash end |