module Sequoia::Configurable
Module: Configurable
mixin
Public Instance Methods
build_configuration(env=nil)
click to toggle source
Build configuration object
Params:
-
env {Symbol} Environment to build
Returns: {Sequoia::Entity} builded configuration object
# File lib/sequoia/configurable.rb, line 33 def build_configuration(env=nil) result = config_attributes[:default] result.deep_merge!(config_attributes[env.to_sym]) if env Entity.create(result) end
Also aliased as: build_config
configure(env=:default, &block)
click to toggle source
Add or merge environment configuration
Params:
-
env {Symbol} Environment to set (optional, default: :default)
Yields: block with key-value definitions
Returns: {Sequoia::Builder} builder instance
# File lib/sequoia/configurable.rb, line 19 def configure(env=:default, &block) environment = config_attributes[env.to_sym] Builder.new(environment, &block) end
Protected Instance Methods
config_attributes()
click to toggle source
Config environments storage
# File lib/sequoia/configurable.rb, line 45 def config_attributes @config_attributes ||= Hash.new { |hash, key| hash[key] = Store.new } end