Sha256: 1644d71672f7e723986bf24966033cb276a557947cc880aef4dc856d6ad51f93

Contents?: true

Size: 734 Bytes

Versions: 4

Compression:

Stored size: 734 Bytes

Contents

module WhoAmI
  module Function
    class AnnotateModels
      include ProcParty

      def initialize(config, tables)
        @config = config
        @tables = tables
      end

      def call
        paths
          .flat_map(&Ls.new)
          .flat_map(&ParseModel.new)
          .tap(&ExtractModelData.new)
          .select(&:activerecord?)
          .reject(&:abstract_class?)
          .each(&ResolveTable.new(@tables))
          .reject(&:skipped?)
          .each(&ComputeComment.new)
          .reject(&:skipped?)
          .each(&ComputeContent.new)
          .reject(&:skipped?)
          .each(&WriteModel.new)
      end

      private

      def paths
        @config.annotate_models_paths
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
who_am_i-0.0.6 lib/who_am_i/function/annotate_models.rb
who_am_i-0.0.5 lib/who_am_i/function/annotate_models.rb
who_am_i-0.0.4 lib/who_am_i/function/annotate_models.rb
who_am_i-0.0.3 lib/who_am_i/function/annotate_models.rb