Class: GenesisRuby::Connection
- Inherits:
-
Object
- Object
- GenesisRuby::Connection
- Defined in:
- lib/genesis_ruby/connection.rb
Overview
Prepare the Network connection used for sending the current request
Class Method Summary collapse
-
.for(configuration) ⇒ Object
Initialize Network Factory based on the Configuration.
Class Method Details
.for(configuration) ⇒ Object
Initialize Network Factory based on the Configuration
12 13 14 15 16 17 18 19 |
# File 'lib/genesis_ruby/connection.rb', line 12 def self.for(configuration) case configuration.interface when GenesisRuby::Configuration::NETWORK_INTERFACE_NET_HTTP GenesisRuby::Network::NetHttp.new(configuration) else raise GenesisRuby::NetworkError, 'Invalid network interface given.' end end |