Class: ImageServer::AttachmentUploader

Inherits:
Object
  • Object
show all
Defined in:
lib/image_server/attachment_uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(namespace, hash, configuration: ImageServer.configuration) ⇒ AttachmentUploader

Returns a new instance of AttachmentUploader.



5
6
7
8
9
# File 'lib/image_server/attachment_uploader.rb', line 5

def initialize(namespace, hash, configuration: ImageServer.configuration)
  @namespace = namespace
  @hash = hash
  @configuration = configuration
end

Instance Method Details

#upload(name, source) ⇒ Object



11
12
13
14
# File 'lib/image_server/attachment_uploader.rb', line 11

def upload(name, source)
  uploader = Adapters::Http.new(@namespace, source, configuration: @configuration)
  properties_json = uploader.upload(uri(name))
end