class Train::Plugins::Transport
Attributes
logger[R]
@return [Logger] logger for reporting information
Public Class Methods
name(name)
click to toggle source
Register the inheriting class with as a train plugin using the provided name.
@param [String] name of the plugin, by which it will be found
# File lib/train/plugins/transport.rb, line 40 def self.name(name) Train::Plugins.registry[name] = self end
new(options = {})
click to toggle source
Initialize a new Transport
object
@param [Hash] config = nil the configuration for this transport @return [Transport] the transport object
# File lib/train/plugins/transport.rb, line 22 def initialize(options = {}) @options = merge_options({}, options || {}) @logger = @options[:logger] || Logger.new(STDOUT) end
Public Instance Methods
connection(_options = nil)
click to toggle source
Create a connection to the target. Options may be provided for additional configuration.
@param [Hash] _options = nil provide optional configuration params @return [Connection] the connection for this configuration
# File lib/train/plugins/transport.rb, line 32 def connection(_options = nil) fail Train::ClientError, "#{self.class} does not implement #connect()" end