Class: Servitude::Configuration
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Servitude::Configuration
- Defined in:
- lib/servitude/configuration.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.config_filepath ⇒ Object
15 16 17 |
# File 'lib/servitude/configuration.rb', line 15 def self.config_filepath Servitude::DEFAULT_CONFIG_PATH end |
.load(options = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/servitude/configuration.rb', line 9 def self.load( ={} ) = defaults.merge( ) = .merge( ) new( ) end |
Instance Method Details
#config_filepath ⇒ Object
19 20 21 |
# File 'lib/servitude/configuration.rb', line 19 def config_filepath Pathname.new( self.class.config_filepath ) end |
#for_env ⇒ Object
27 28 29 30 |
# File 'lib/servitude/configuration.rb', line 27 def for_env return Hashie::Mash.new({}) unless env self[env] end |
#slice(*keys) ⇒ Object
23 24 25 |
# File 'lib/servitude/configuration.rb', line 23 def slice( *keys ) klass.new( select { |k,v| keys.map( &:to_s ).include?( k ) } ) end |