Sha256: 89a1b28e182bd52b5948b0e8e4e001a5314119e992d32702272cbd1a5a7cb446

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

module Inch
  module Language
    module Ruby
      module Evaluation
        # Base class for all Ruby related evaluations
        #
        # @abstract
        class Base < Inch::Evaluation::Proxy
          protected

          def relevant_base_roles
            {
              Role::Object::InRoot => nil,
              Role::Object::Public => nil,
              Role::Object::Protected => nil,
              Role::Object::Private => nil,
              Role::Object::TaggedAsNodoc => nil,
              Role::Object::WithDoc => score_for(:docstring),
              Role::Object::WithoutDoc => score_for(:docstring),
              Role::Object::WithCodeExample => score_for(:code_example_single),
              Role::Object::WithMultipleCodeExamples =>
                score_for(:code_example_multi),
              Role::Object::WithoutCodeExample =>
                score_for(:code_example_single),
              Role::Object::Tagged => score_for_unconsidered_tags,
              Role::Object::TaggedAsAPI => nil,
              Role::Object::TaggedAsInternalAPI => nil,
              Role::Object::TaggedAsPrivate => nil,
              Role::Object::Alias =>
                if object.alias?
                  object.aliased_object.score
                else
                  nil
                end
            }
          end

          def score_for_unconsidered_tags
            count = object.unconsidered_tag_count
            score_for(:unconsidered_tag) * count
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inch-0.5.0.rc7 lib/inch/language/ruby/evaluation/base.rb
inch-0.5.0.rc6 lib/inch/language/ruby/evaluation/base.rb