Class: Zaala::API::Attachment

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/zaala/api/types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_message(h) ⇒ Object



473
474
475
476
477
478
479
# File 'lib/zaala/api/types.rb', line 473

def self.from_message(h)
  Attachment.new({
    name: h[:name],
    mime_type: h[:mimeType],
    value: h[:value],
  })
end

Instance Method Details

#to_messageObject



481
482
483
484
485
486
487
# File 'lib/zaala/api/types.rb', line 481

def to_message
  {
    :@name => name,
    :@mimeType => mime_type,
    value: value
  }
end