class Gaston
Constants
- VERSION
Public Class Methods
configure(&block)
click to toggle source
Define a configure block.
Delegates to Gaston::Configuration
@example Define the option.
Gaston.configure do |config| config.env = :test config.files = Dir[Rails.root.join("config/libraries/**/*.rb"] end
@param [ Proc ] block The block getting called.
@since 0.0.1
# File lib/gaston.rb, line 40 def configure(&block) self::Configuration.configure(&block) self.instance.store.each do |key, value| define_singleton_method key do value end end end
Public Instance Methods
store()
click to toggle source
Parse
yml config files, merge them, and store into gaston::Store
@since 0.0.1
# File lib/gaston.rb, line 20 def store @store ||= Gaston::Builder.new(self.class, hash_from_files) end
Private Instance Methods
env()
click to toggle source
Current enironment.
@since 0.0.1
# File lib/gaston.rb, line 64 def env Gaston::Configuration.env.to_sym end
files()
click to toggle source
List config files.
@since 0.0.1
# File lib/gaston.rb, line 56 def files Gaston::Configuration.files end
hash_from_files()
click to toggle source
Return one merged hash from yaml config files.
@return [ Hash ]
@since 0.0.2
# File lib/gaston.rb, line 74 def hash_from_files @hash_from_files ||= Gaston::Parse.new(files, env).to_hash end