Class: Atlantis::S3Client

Inherits:
Object
  • Object
show all
Defined in:
lib/atlantis/s3_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeS3Client

Returns a new instance of S3Client.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/atlantis/s3_client.rb', line 10

def initialize

  @url = 'https://upload.atlantis.sodalis.com.au.s3.amazonaws.com'
  @http = Faraday.new(url: @url, ssl: {verify: false}) do |builder|
  	builder.request :multipart
  	builder.request :url_encoded
    builder.options[:read_timeout] = 400
    builder.options[:open_timeout] = 200
    builder.adapter :excon
  end

  @http.headers = {
    user_agent: "Atlantis Ruby Gem #{Atlantis::VERSION}",
  }

end

Instance Attribute Details

#httpObject (readonly)

Returns the value of attribute http.



8
9
10
# File 'lib/atlantis/s3_client.rb', line 8

def http
  @http
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/atlantis/s3_client.rb', line 8

def url
  @url
end

Instance Method Details

#post(params = {}) ⇒ Object



27
28
29
# File 'lib/atlantis/s3_client.rb', line 27

def post params={}
  http.post '/', params     
end