Class: WhiskeyDisk::Config::EnvironmentScopeFilter
- Inherits:
-
AbstractFilter
- Object
- AbstractFilter
- WhiskeyDisk::Config::EnvironmentScopeFilter
- Includes:
- ScopeHelper
- Defined in:
- lib/whiskey_disk/config/filters/environment_scope_filter.rb
Instance Attribute Summary
Attributes inherited from AbstractFilter
Instance Method Summary collapse
- #filter(data) ⇒ Object
-
#needs_environment_scoping?(data) ⇒ Boolean
is this data hash a bottom-level data hash without an environment name?.
Methods included from ScopeHelper
Methods inherited from AbstractFilter
#environment_name, #initialize, #project_name
Constructor Details
This class inherits a constructor from WhiskeyDisk::Config::AbstractFilter
Instance Method Details
#filter(data) ⇒ Object
14 15 16 17 |
# File 'lib/whiskey_disk/config/filters/environment_scope_filter.rb', line 14 def filter(data) return data unless needs_environment_scoping?(data) { environment_name => data } end |
#needs_environment_scoping?(data) ⇒ Boolean
is this data hash a bottom-level data hash without an environment name?
10 11 12 |
# File 'lib/whiskey_disk/config/filters/environment_scope_filter.rb', line 10 def needs_environment_scoping?(data) repository_depth(data) == 0 end |