Class: FaradayCage::Config
- Inherits:
-
Object
- Object
- FaradayCage::Config
- Defined in:
- lib/faraday_cage/config.rb
Overview
Handles configuration of Faraday connection and server options.
Instance Attribute Summary collapse
- #app ⇒ Object
-
#default_host ⇒ Object
Returns the value of attribute default_host.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #middleware(&block) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 |
# File 'lib/faraday_cage/config.rb', line 10 def initialize self.default_host = 'http://example.com' end |
Instance Attribute Details
#app ⇒ Object
14 15 16 17 18 |
# File 'lib/faraday_cage/config.rb', line 14 def app @app ||= begin default_rails_app if defined?(Rails) end end |
#default_host ⇒ Object
Returns the value of attribute default_host.
6 7 8 |
# File 'lib/faraday_cage/config.rb', line 6 def default_host @default_host end |
Instance Method Details
#middleware(&block) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/faraday_cage/config.rb', line 20 def middleware(&block) if block_given? @middleware = block else @middleware end end |