Class: Qbrick::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Qbrick::Engine
- Defined in:
- lib/qbrick/engine.rb
Instance Method Summary collapse
Instance Method Details
#app_config ⇒ Object
27 28 29 |
# File 'lib/qbrick/engine.rb', line 27 def app_config Rails.application.config end |
#host ⇒ Object
40 41 42 43 44 |
# File 'lib/qbrick/engine.rb', line 40 def host return hosts.first unless app_config.respond_to? :host app_config.host end |
#hosts ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/qbrick/engine.rb', line 31 def hosts [Socket.gethostname, 'localhost'].tap do |result| result.concat [app_config.hosts].flatten if app_config.respond_to? :hosts result.concat [app_config.host].flatten if app_config.respond_to? :host result.compact! result.uniq! end end |
#port ⇒ Object
52 53 54 55 56 |
# File 'lib/qbrick/engine.rb', line 52 def port return 80 unless app_config.respond_to? :port app_config.port end |
#scheme ⇒ Object
46 47 48 49 50 |
# File 'lib/qbrick/engine.rb', line 46 def scheme return 'http' unless app_config.respond_to? :scheme app_config.scheme end |