# frozen_string_literal: true module ConvenientService module Feature module Plugins module CanHaveEntries module Commands class DefineEntries < Support::Command ## # @!attribute [r] feature_class # @return [Class] # attr_reader :feature_class ## # @!attribute [r] names # @return [Array] # attr_reader :names ## # @!attribute [r] body # @return [Proc, nil] # attr_reader :body ## # @param feature_class [Class] # @param names [Array] # @param body [Proc, nil] # def initialize(feature_class:, names:, body:) @feature_class = feature_class @names = names @body = body end ## # @return [Array] # def call names.map { |name| Commands::DefineEntry.call(feature_class: feature_class, name: name, body: body) } end end end end end end end