module Lambdable

Public Instance Methods

event() click to toggle source
# File lib/lambdable.rb, line 28
def event
  "#{model.class.name.underscore.upcase}_PROCESSED"
end
message() click to toggle source
# File lib/lambdable.rb, line 32
def message
  ActiveModelSerializers::SerializableResource.new(model).to_json
end
routing_key() click to toggle source
# File lib/lambdable.rb, line 24
def routing_key
  "apps.#{model.app_id}.media.#{model.class.name.underscore}.#{model.id}.processed"
end
sqs() click to toggle source
# File lib/lambdable.rb, line 16
def sqs
  if model.app_id
    tags.merge! 'x-amz-meta-process-sqs' => "events|#{routing_key}|#{message}|#{event}"
  else
    tags
  end
end
tags() click to toggle source
# File lib/lambdable.rb, line 4
def tags
  @tags ||= { }
end
type(*attrs) click to toggle source
# File lib/lambdable.rb, line 12
def type(*attrs)
  tags.merge! 'x-amz-meta-process-image-type' => attrs.join(';')
end
version(*attrs) click to toggle source
# File lib/lambdable.rb, line 8
def version(*attrs)
  tags.merge! 'x-amz-meta-process-size-versions' => attrs.join(';')
end