Class: Cyclid::API::Config
- Inherits:
-
Object
- Object
- Cyclid::API::Config
- Defined in:
- app/cyclid/config.rb
Overview
Cyclid API configuration
Instance Attribute Summary collapse
-
#builder ⇒ Object
readonly
Returns the value of attribute builder.
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#dispatcher ⇒ Object
readonly
Returns the value of attribute dispatcher.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
Instance Method Summary collapse
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/cyclid/config.rb', line 24 def initialize(path) config = YAML.load_file(path) server = config['server'] @database = server['database'] @log = server['log'] || File.join(%w(/ var log cyclid server)) @dispatcher = server['dispatcher'] @builder = server['builder'] @plugins = server['plugins'] || {} rescue StandardError => ex abort "Failed to load configuration file #{path}: #{ex}" end |
Instance Attribute Details
#builder ⇒ Object (readonly)
Returns the value of attribute builder.
22 23 24 |
# File 'app/cyclid/config.rb', line 22 def builder @builder end |
#database ⇒ Object (readonly)
Returns the value of attribute database.
22 23 24 |
# File 'app/cyclid/config.rb', line 22 def database @database end |
#dispatcher ⇒ Object (readonly)
Returns the value of attribute dispatcher.
22 23 24 |
# File 'app/cyclid/config.rb', line 22 def dispatcher @dispatcher end |
#log ⇒ Object (readonly)
Returns the value of attribute log.
22 23 24 |
# File 'app/cyclid/config.rb', line 22 def log @log end |
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins.
22 23 24 |
# File 'app/cyclid/config.rb', line 22 def plugins @plugins end |