Class: Kennedy::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Kennedy::Server
- Defined in:
- lib/kennedy/server.rb
Class Method Summary collapse
-
.create(opts = {}) ⇒ Object
Creates a new subclass of Kennedy::Server with the given options.
Class Method Details
.create(opts = {}) ⇒ Object
Creates a new subclass of Kennedy::Server with the given options
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kennedy/server.rb', line 21 def self.create(opts = {}) sc = Class.new(self) sc.instance_eval do opts.each { |k,v| set k.to_sym, v } raise ArgumentError, "A session secret must be set with :session_secret" unless defined?(session_secret) set :api_keys, (defined?(api_keys) ? api_keys : {}) set :require_ssl, (defined?(require_ssl) ? require_ssl : true) end end |