Class: Kamerling::Settings
Instance Method Summary collapse
-
#initialize(args) ⇒ Settings
constructor
A new instance of Settings.
- #server_addrs ⇒ Object
Methods inherited from Value
Constructor Details
#initialize(args) ⇒ Settings
Returns a new instance of Settings.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/kamerling/settings.rb', line 9 def initialize(args) super db: 'sqlite::memory:', host: '127.0.0.1' OptionParser.new do |opt| opt.on("--db #{db}", String, 'database') { |db| self.db = db } opt.on("--host #{host}", String, 'host') { |host| self.host = host } opt.on('--http 0', Integer, 'HTTP port') { |http| self.http = http } opt.on('--tcp 0', Integer, 'TCP port') { |tcp| self.tcp = tcp } opt.on('--udp 0', Integer, 'UDP port') { |udp| self.udp = udp } end.parse! args end |