Class: BoringBuilder::Exporters::Resolver
- Inherits:
-
Object
- Object
- BoringBuilder::Exporters::Resolver
- Defined in:
- lib/boringbuilder/exporters/resolver.rb
Constant Summary collapse
- ADAPTERS =
{ local: Local, boringcache: BoringCache }.freeze
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #destinations ⇒ Object
-
#initialize(project, client, environment: ENV) ⇒ Resolver
constructor
A new instance of Resolver.
- #plan ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(project, client, environment: ENV) ⇒ Resolver
Returns a new instance of Resolver.
13 14 15 16 17 18 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 13 def initialize(project, client, environment: ENV) @project = project @client = client @environment = environment @cache = ::BoringBuilder::BoringCache.new(project, client, environment: environment) end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
11 12 13 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 11 def cache @cache end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 11 def client @client end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
11 12 13 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 11 def project @project end |
Instance Method Details
#destinations ⇒ Object
20 21 22 23 24 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 20 def destinations names = [primary_name].compact names << :local if configuration.output && !names.include?(:local) names.map { |name| adapter(name) } end |
#plan ⇒ Object
26 27 28 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 26 def plan destinations.map(&:name) end |
#validate! ⇒ Object
30 31 32 33 |
# File 'lib/boringbuilder/exporters/resolver.rb', line 30 def validate! destinations.each(&:validate!) self end |