class MessageQuickly::Messaging::AudioAttachment
Attributes
file[RW]
file_type[RW]
url[RW]
Public Class Methods
new(params = {})
click to toggle source
Calls superclass method
# File lib/message_quickly/messaging/audio_attachment.rb, line 7 def initialize(params = {}) params['type'] ||= 'audio' super(params) end
Public Instance Methods
file?()
click to toggle source
# File lib/message_quickly/messaging/audio_attachment.rb, line 12 def file? file.present? && file_type.present? end
to_hash()
click to toggle source
# File lib/message_quickly/messaging/audio_attachment.rb, line 16 def to_hash if file? { type: type, payload: { url: '' } } # cannot send empty hash else { type: type, payload: { url: url } } end end