Sha256: 719948f657a463d404e21ec549a1faf32804f9099fab07f89109a67b1b1f9c52

Contents?: true

Size: 1.99 KB

Versions: 6

Compression:

Stored size: 1.99 KB

Contents

# frozen_string_literal: true

##
# Usage example:
#
# result = ConvenientService::Examples::Rails::Gemfile.format(path: "Gemfile")
# result = ConvenientService::Examples::Rails::Gemfile.format(path: "spec/cli/gemfile/format/fixtures/Gemfile")
#
module ConvenientService
  module Examples
    module Rails
      module Gemfile
        class RailsService
          module Config
            include Support::Concern

            included do |service_class|
              service_class.class_exec do
                include ConvenientService::Standard::Config

                ##
                # NOTE: `AssignsAttributesInConstructor::UsingActiveModelAttributeAssignment` plugin.
                #
                concerns do
                  use ConvenientService::Plugins::Common::AssignsAttributesInConstructor::UsingActiveModelAttributeAssignment::Concern
                end

                middlewares :initialize do
                  use ConvenientService::Plugins::Common::AssignsAttributesInConstructor::UsingActiveModelAttributeAssignment::Middleware
                end

                ##
                # NOTE: `HasAttributes::UsingActiveModelAttributes` plugin.
                #
                concerns do
                  use ConvenientService::Plugins::Common::HasAttributes::UsingActiveModelAttributes::Concern
                end

                ##
                # NOTE: `HasResultParamsValidations::UsingActiveModelValidations` plugin.
                #
                concerns do
                  use ConvenientService::Plugins::Service::HasResultParamsValidations::UsingActiveModelValidations::Concern
                end

                middlewares :result do
                  insert_before \
                    ConvenientService::Plugins::Service::HasResult::Middleware,
                    ConvenientService::Plugins::Service::HasResultParamsValidations::UsingActiveModelValidations::Middleware
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
convenient_service-0.12.0 lib/convenient_service/examples/rails/gemfile/rails_service/config.rb
convenient_service-0.11.0 lib/convenient_service/examples/rails/gemfile/rails_service/config.rb
convenient_service-0.10.1 lib/convenient_service/examples/rails/gemfile/rails_service/config.rb
convenient_service-0.10.0 lib/convenient_service/examples/rails/gemfile/rails_service/config.rb
convenient_service-0.9.0 lib/convenient_service/examples/rails/gemfile/rails_service/config.rb
convenient_service-0.8.0 lib/convenient_service/examples/rails/gemfile/rails_service/config.rb