Class: Bane::CommandLineConfiguration::LinearPortMappedBehaviorConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/bane/command_line_configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(port, behaviors, host) ⇒ LinearPortMappedBehaviorConfiguration

Returns a new instance of LinearPortMappedBehaviorConfiguration.



70
71
72
73
74
# File 'lib/bane/command_line_configuration.rb', line 70

def initialize(port, behaviors, host)
  @starting_port = port
  @behaviors = behaviors
  @host = host
end

Instance Method Details

#serversObject



76
77
78
79
80
81
82
# File 'lib/bane/command_line_configuration.rb', line 76

def servers
  configurations = []
  @behaviors.each_with_index do |behavior, index|
    configurations << BehaviorServer.new(@starting_port + index, behavior.new, @host)
  end
  configurations
end