Class: WhiskeyDisk::Config::Filter
- Inherits:
-
Object
- Object
- WhiskeyDisk::Config::Filter
- Defined in:
- lib/whiskey_disk/config/filter.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
Instance Method Summary collapse
- #filter_data(data) ⇒ Object
-
#initialize(config) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
#initialize(config) ⇒ Filter
Returns a new instance of Filter.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/whiskey_disk/config/filter.rb', line 21 def initialize(config) @config = config @filters = [ StringifyHashKeysFilter, EnvironmentScopeFilter, ProjectScopeFilter, SelectProjectAndEnvironmentFilter, AddEnvironmentNameFilter, AddProjectNameFilter, DefaultConfigTargetFilter, DefaultDomainFilter, HashifyDomainEntriesFilter, LocalizeDomainsFilter, CheckForDuplicateDomainsFilter, ConvertRoleStringsToListFilter, DropEmptyDomainRolesFilter, NormalizeSshOptionsFilter ] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
19 20 21 |
# File 'lib/whiskey_disk/config/filter.rb', line 19 def config @config end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
19 20 21 |
# File 'lib/whiskey_disk/config/filter.rb', line 19 def filters @filters end |
Instance Method Details
#filter_data(data) ⇒ Object
41 42 43 44 45 |
# File 'lib/whiskey_disk/config/filter.rb', line 41 def filter_data(data) filters.inject(data.clone) do |result, filter| result = filter.new(config).filter(result) end end |