Module: Morpheus::Configuration
Instance Method Summary collapse
-
#allow_net_connect=(allowed) ⇒ Object
Can be set or unset to allow for test suite mocking.
- #allow_net_connect? ⇒ Boolean
- #attributes ⇒ Object
- #host ⇒ Object
-
#host=(host) ⇒ Object
Sets and gets the remote host service domain.
-
#hydra ⇒ Object
Links to the underlying libcurl request pool.
- #hydra=(hydra) ⇒ Object
-
#logger ⇒ Object
Handles the default logger that is used by the LogSubscriber.
- #logger=(logger) ⇒ Object
- #parse_error_handler ⇒ Object
- #parse_error_handler=(handler) ⇒ Object
- #password ⇒ Object
- #password=(password) ⇒ Object
- #username ⇒ Object
- #username=(username) ⇒ Object
Instance Method Details
#allow_net_connect=(allowed) ⇒ Object
Can be set or unset to allow for test suite mocking.
56 57 58 |
# File 'lib/morpheus/configuration.rb', line 56 def allow_net_connect=(allowed) Typhoeus::Hydra.allow_net_connect = allowed end |
#allow_net_connect? ⇒ Boolean
63 64 65 |
# File 'lib/morpheus/configuration.rb', line 63 def allow_net_connect? Typhoeus::Hydra.allow_net_connect? end |
#attributes ⇒ Object
5 6 7 |
# File 'lib/morpheus/configuration.rb', line 5 def attributes @attributes ||= {} end |
#host ⇒ Object
31 32 33 34 |
# File 'lib/morpheus/configuration.rb', line 31 def host attributes[:host] || raise(Morpheus::ConfigurationError, 'The request HOST has not been set. Please set the host using Morpheus::Configuration.host = "http://www.example.com"') end |
#host=(host) ⇒ Object
Sets and gets the remote host service domain. The domain must be set before any requests can be made.
27 28 29 |
# File 'lib/morpheus/configuration.rb', line 27 def host=(host) attributes[:host] = host end |
#hydra ⇒ Object
Links to the underlying libcurl request pool. Allows for concurrent requests.
38 39 40 |
# File 'lib/morpheus/configuration.rb', line 38 def hydra attributes[:hydra] ||= Typhoeus::Hydra.hydra end |
#hydra=(hydra) ⇒ Object
42 43 44 |
# File 'lib/morpheus/configuration.rb', line 42 def hydra=(hydra) attributes[:hydra] = Typhoeus::Hydra.hydra = hydra end |
#logger ⇒ Object
Handles the default logger that is used by the LogSubscriber
47 48 49 |
# File 'lib/morpheus/configuration.rb', line 47 def logger attributes[:logger] ||= ::Logger.new(STDOUT) end |
#logger=(logger) ⇒ Object
51 52 53 |
# File 'lib/morpheus/configuration.rb', line 51 def logger=(logger) attributes[:logger] = logger end |
#parse_error_handler ⇒ Object
67 68 69 |
# File 'lib/morpheus/configuration.rb', line 67 def parse_error_handler attributes[:parse_error_handler] end |
#parse_error_handler=(handler) ⇒ Object
71 72 73 |
# File 'lib/morpheus/configuration.rb', line 71 def parse_error_handler=(handler) attributes[:parse_error_handler] = handler end |
#password ⇒ Object
21 22 23 |
# File 'lib/morpheus/configuration.rb', line 21 def password attributes[:password] end |
#password=(password) ⇒ Object
17 18 19 |
# File 'lib/morpheus/configuration.rb', line 17 def password=(password) attributes[:password] = password end |
#username ⇒ Object
13 14 15 |
# File 'lib/morpheus/configuration.rb', line 13 def username attributes[:username] end |
#username=(username) ⇒ Object
9 10 11 |
# File 'lib/morpheus/configuration.rb', line 9 def username=(username) attributes[:username] = username end |