Sha256: b88ee6bda7fd8fe7ff6f930097c40f82c683db2627c5fc31133b4f94f2ea68f2
Contents?: true
Size: 555 Bytes
Versions: 13
Compression:
Stored size: 555 Bytes
Contents
# frozen_string_literal: true require_relative 'name' module RubyGitCrypt 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
13 entries across 13 versions & 1 rubygems