Class: Notes::Server
- Inherits:
-
Object
- Object
- Notes::Server
- Defined in:
- lib/notes-cli/server.rb
Constant Summary collapse
- SERVER_DEFAULTS =
{ :Host => '127.0.0.1', :Port => '9292' }
Instance Method Summary collapse
-
#initialize(argv) ⇒ Server
constructor
A new instance of Server.
- #parse_options(args) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(argv) ⇒ Server
Returns a new instance of Server.
12 13 14 |
# File 'lib/notes-cli/server.rb', line 12 def initialize(argv) @options = SERVER_DEFAULTS.merge((argv)) end |
Instance Method Details
#parse_options(args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/notes-cli/server.rb', line 16 def (args) = {} OptionParser.new do |opts| opts.on('-p', '--port [PORT]', 'The port to run on') do |port| [:Port] = port end end.parse!(args) end |