Class: ActiveProjection::Server
- Inherits:
-
Object
- Object
- ActiveProjection::Server
- Defined in:
- lib/active_projection/server.rb
Instance Attribute Summary collapse
- #options ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
- #config_file ⇒ Object
- #env ⇒ Object
-
#initialize(new_options = nil) ⇒ Server
constructor
A new instance of Server.
- #run ⇒ Object
Constructor Details
#initialize(new_options = nil) ⇒ Server
Returns a new instance of Server.
10 11 12 |
# File 'lib/active_projection/server.rb', line 10 def initialize( = nil) self. = .deep_symbolize_keys! unless .nil? end |
Instance Attribute Details
#options ⇒ Object
23 24 25 |
# File 'lib/active_projection/server.rb', line 23 def ||= (ARGV) end |
Class Method Details
.run(options = nil) ⇒ Object
6 7 8 |
# File 'lib/active_projection/server.rb', line 6 def self.run( = nil) self.new().run end |
Instance Method Details
#config_file ⇒ Object
30 31 32 |
# File 'lib/active_projection/server.rb', line 30 def config_file self.class.config_file || File.('config/disco.yml', base_path) end |
#env ⇒ Object
19 20 21 |
# File 'lib/active_projection/server.rb', line 19 def env @env = ENV['PROJECTION_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development' end |
#run ⇒ Object
14 15 16 17 |
# File 'lib/active_projection/server.rb', line 14 def run ActiveRecord::Base.establish_connection [:projection_database] EventClient.start end |