Class: Orbit::Config
Instance Attribute Summary collapse
-
#app_path ⇒ Object
Returns the value of attribute app_path.
-
#log_appname ⇒ Object
Returns the value of attribute log_appname.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger_class ⇒ Object
Returns the value of attribute logger_class.
-
#path_class ⇒ Object
Returns the value of attribute path_class.
-
#rack_logger_class ⇒ Object
Returns the value of attribute rack_logger_class.
-
#request_class ⇒ Object
Returns the value of attribute request_class.
-
#response_class ⇒ Object
Returns the value of attribute response_class.
-
#route_class ⇒ Object
Returns the value of attribute route_class.
-
#router_class ⇒ Object
Returns the value of attribute router_class.
-
#session_options ⇒ Object
Returns the value of attribute session_options.
-
#session_secret ⇒ Object
Returns the value of attribute session_secret.
-
#static_files_path ⇒ Object
Returns the value of attribute static_files_path.
Class Method Summary collapse
- .app_path ⇒ Object
- .logger ⇒ Object
- .logger_class ⇒ Object
- .path_class ⇒ Object
- .request_class ⇒ Object
- .response_class ⇒ Object
- .route_class ⇒ Object
- .router_class ⇒ Object
- .session_options ⇒ Object
- .session_secret ⇒ Object
- .static_files_path ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #set_default_config ⇒ Object
Methods included from Singleton
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
14 15 16 17 18 |
# File 'lib/orbit/config.rb', line 14 def initialize instantiate set_default_config end |
Instance Attribute Details
#app_path ⇒ Object
Returns the value of attribute app_path.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def app_path @app_path end |
#log_appname ⇒ Object
Returns the value of attribute log_appname.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def log_appname @log_appname end |
#log_file ⇒ Object
Returns the value of attribute log_file.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def log_file @log_file end |
#log_level ⇒ Object
Returns the value of attribute log_level.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def log_level @log_level end |
#logger_class ⇒ Object
Returns the value of attribute logger_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def logger_class @logger_class end |
#path_class ⇒ Object
Returns the value of attribute path_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def path_class @path_class end |
#rack_logger_class ⇒ Object
Returns the value of attribute rack_logger_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def rack_logger_class @rack_logger_class end |
#request_class ⇒ Object
Returns the value of attribute request_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def request_class @request_class end |
#response_class ⇒ Object
Returns the value of attribute response_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def response_class @response_class end |
#route_class ⇒ Object
Returns the value of attribute route_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def route_class @route_class end |
#router_class ⇒ Object
Returns the value of attribute router_class.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def router_class @router_class end |
#session_options ⇒ Object
Returns the value of attribute session_options.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def @session_options end |
#session_secret ⇒ Object
Returns the value of attribute session_secret.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def session_secret @session_secret end |
#static_files_path ⇒ Object
Returns the value of attribute static_files_path.
9 10 11 |
# File 'lib/orbit/config.rb', line 9 def static_files_path @static_files_path end |
Class Method Details
.app_path ⇒ Object
41 42 43 |
# File 'lib/orbit/config.rb', line 41 def self.app_path @instance.app_path end |
.logger ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/orbit/config.rb', line 57 def self.logger @_logger ||= begin logger_class.new(@instance.log_file).tap do |logger| logger.level = @instance.log_level logger.progname = @instance.log_appname end end end |
.logger_class ⇒ Object
53 54 55 |
# File 'lib/orbit/config.rb', line 53 def self.logger_class @instance.logger_class end |
.path_class ⇒ Object
66 67 68 |
# File 'lib/orbit/config.rb', line 66 def self.path_class @instance.path_class end |
.request_class ⇒ Object
70 71 72 |
# File 'lib/orbit/config.rb', line 70 def self.request_class @instance.request_class end |
.response_class ⇒ Object
74 75 76 |
# File 'lib/orbit/config.rb', line 74 def self.response_class @instance.response_class end |
.route_class ⇒ Object
78 79 80 |
# File 'lib/orbit/config.rb', line 78 def self.route_class @instance.route_class end |
.router_class ⇒ Object
82 83 84 |
# File 'lib/orbit/config.rb', line 82 def self.router_class @instance.router_class end |
.session_options ⇒ Object
45 46 47 |
# File 'lib/orbit/config.rb', line 45 def self. @instance. end |
.session_secret ⇒ Object
86 87 88 |
# File 'lib/orbit/config.rb', line 86 def self.session_secret @instance.session_secret end |
.static_files_path ⇒ Object
49 50 51 |
# File 'lib/orbit/config.rb', line 49 def self.static_files_path @instance.static_files_path end |
Instance Method Details
#set_default_config ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/orbit/config.rb', line 20 def set_default_config @app_path = 'app' @static_files_path = ["/media"] @session_secret = 'session_secret' # Logging options @logger_class = Logger @log_level = Logger::DEBUG @log_file = STDOUT @log_appname = 'Orbit App' # Classes @rack_logger_class = Rack::Logger @path_class = Orbit::Routing::Path @request_class = Orbit::Request @response_class = Orbit::Response @route_class = Orbit::Routing::Route @router_class = Orbit::Router @session_options = {} end |