Sha256: 1f801b6dcc134030a91158ec6c14b6caf53994c44a37bc3f84451d624759b5d5
Contents?: true
Size: 556 Bytes
Versions: 73
Compression:
Stored size: 556 Bytes
Contents
# frozen_string_literal: true require_relative 'name' module RubyTerraform module Options class Factory def initialize(definitions) @definitions = definitions end def resolve(names, parameters) names .map { |name| Name.new(name) } .inject([]) do |options, name| options + resolve_name(name, parameters) end end private def resolve_name(name, parameters) @definitions.find { |d| d.matches?(name) }.build(parameters) end end end end
Version data entries
73 entries across 73 versions & 1 rubygems