class Acclimate::Configuration

Public Class Methods

config_filepath() click to toggle source
# File lib/acclimate/configuration.rb, line 12
def self.config_filepath
end
load( options={} ) click to toggle source
# File lib/acclimate/configuration.rb, line 8
def self.load( options={} )
  new( file_options.merge( options ))
end

Protected Class Methods

file_options() click to toggle source
# File lib/acclimate/configuration.rb, line 30
def self.file_options
  return {} unless config_filepath

  File.exists?( config_filepath ) ?
    load_file_options :
    {}
end
load_file_options() click to toggle source
# File lib/acclimate/configuration.rb, line 38
def self.load_file_options
  YAML::load( File.read( config_filepath ))
end

Public Instance Methods

config_filepath() click to toggle source
# File lib/acclimate/configuration.rb, line 15
def config_filepath
  Pathname.new( self.class.config_filepath )
end
for_env() click to toggle source
# File lib/acclimate/configuration.rb, line 23
def for_env
  return Hashie::Mash.new({}) unless env
  self[env]
end
slice( *keys ) click to toggle source
# File lib/acclimate/configuration.rb, line 19
def slice( *keys )
  klass.new( select { |k,v| keys.map( &:to_s ).include?( k ) } )
end

Protected Instance Methods

klass() click to toggle source
# File lib/acclimate/configuration.rb, line 42
def klass
  self.class
end