Class: Atlantis::S3Client
- Inherits:
-
Object
- Object
- Atlantis::S3Client
- Defined in:
- lib/atlantis/s3_client.rb
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize ⇒ S3Client
constructor
A new instance of S3Client.
- #post(params = {}) ⇒ Object
Constructor Details
#initialize ⇒ S3Client
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.[:read_timeout] = 400 builder.[:open_timeout] = 200 builder.adapter :excon end @http.headers = { user_agent: "Atlantis Ruby Gem #{Atlantis::VERSION}", } end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
8 9 10 |
# File 'lib/atlantis/s3_client.rb', line 8 def http @http end |
#url ⇒ Object (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 |