Class: Ars::Medium::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/ars/medium.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



25
26
27
28
29
30
31
32
33
34
# File 'lib/ars/medium.rb', line 25

def initialize
  @url = 'http://localhost/'
  @ssl = {verify: false}
  @middleware = [
    [:request, :multipart],
    [:request, :url_encoded],
    [:use,     Her::Middleware::DefaultParseJSON],
    [:adapter, :net_http_persistent]
  ]
end

Instance Attribute Details

#middlewareObject

Returns the value of attribute middleware.



23
24
25
# File 'lib/ars/medium.rb', line 23

def middleware
  @middleware
end

#rootObject

Returns the value of attribute root.



23
24
25
# File 'lib/ars/medium.rb', line 23

def root
  @root
end

#sslObject

Returns the value of attribute ssl.



23
24
25
# File 'lib/ars/medium.rb', line 23

def ssl
  @ssl
end

#urlObject

Returns the value of attribute url.



23
24
25
# File 'lib/ars/medium.rb', line 23

def url
  @url
end

Instance Method Details

#connection_optionsObject



36
37
38
# File 'lib/ars/medium.rb', line 36

def connection_options
  %i{url ssl}.inject({}) {|hash, key| hash[key] = self.send key ; hash}
end