Class: Ars::Medium::Configuration
- Inherits:
-
Object
- Object
- Ars::Medium::Configuration
- Defined in:
- lib/ars/medium.rb
Instance Attribute Summary collapse
-
#middleware ⇒ Object
Returns the value of attribute middleware.
-
#root ⇒ Object
Returns the value of attribute root.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #connection_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#middleware ⇒ Object
Returns the value of attribute middleware.
23 24 25 |
# File 'lib/ars/medium.rb', line 23 def middleware @middleware end |
#root ⇒ Object
Returns the value of attribute root.
23 24 25 |
# File 'lib/ars/medium.rb', line 23 def root @root end |
#ssl ⇒ Object
Returns the value of attribute ssl.
23 24 25 |
# File 'lib/ars/medium.rb', line 23 def ssl @ssl end |
#url ⇒ Object
Returns the value of attribute url.
23 24 25 |
# File 'lib/ars/medium.rb', line 23 def url @url end |
Instance Method Details
#connection_options ⇒ Object
36 37 38 |
# File 'lib/ars/medium.rb', line 36 def %i{url ssl}.inject({}) {|hash, key| hash[key] = self.send key ; hash} end |