Sha256: c797d8397bdceba2db9ed4acd01c7f7f1a76bab93ba6382b2c45dae822a4ab21

Contents?: true

Size: 1.59 KB

Versions: 36

Compression:

Stored size: 1.59 KB

Contents

module Inch
  module Language
    module Elixir
      module Evaluation
        module Role
          # Roles assigned to modules
          module Module
            # Role assigned to modules with children
            #
            # @see CodeObject::Ruby::NamespaceObject#has_children?
            class WithChildren < Base
              applicable_if :has_children?

              # This role doesnot assign a score.
              def score
                0
              end

              # This role sets a max_score.
              def max_score
                # @value.to_f
              end
            end

            # Role assigned to modules with many children
            #
            # @see CodeObject::Ruby::NamespaceObject#has_many_children?
            class WithManyChildren < Base
              applicable_if :has_many_children?

              # +priority
              def priority
                +1
              end
            end

            # Role assigned to modules without any children
            class WithoutChildren < Base
              applicable_unless :has_children?
            end

            # Role assigned to modules without any methods
            class WithoutMethods < Base
              applicable_unless :has_methods?

              def priority
                -2
              end
            end

            # A 'pure' namespace has only modules as children
            class Pure < Base
              applicable_if :pure_namespace?

              def priority
                -2
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
inch-0.9.0.rc1 lib/inch/language/elixir/roles/module.rb
inch-0.8.0 lib/inch/language/elixir/roles/module.rb
inch-0.8.0.rc2 lib/inch/language/elixir/roles/module.rb
inch-0.8.0.rc1 lib/inch/language/elixir/roles/module.rb
inch-0.7.1 lib/inch/language/elixir/roles/module.rb
inch-0.7.0 lib/inch/language/elixir/roles/module.rb
inch-0.6.4 lib/inch/language/elixir/roles/module.rb
inch-0.6.3 lib/inch/language/elixir/roles/module.rb
inch-0.6.2 lib/inch/language/elixir/roles/module.rb
inch-0.6.1 lib/inch/language/elixir/roles/module.rb
inch-0.6.0 lib/inch/language/elixir/roles/module.rb
inch-0.6.0.rc6 lib/inch/language/elixir/roles/module.rb
inch-0.6.0.rc5 lib/inch/language/elixir/roles/module.rb
inch-0.6.0.rc4 lib/inch/language/elixir/roles/module.rb
inch-0.6.0.rc3 lib/inch/language/elixir/roles/module.rb
inch-0.6.0.rc2 lib/inch/language/elixir/roles/module.rb
inch-0.6.0.rc1 lib/inch/language/elixir/roles/module.rb
inch-0.5.10 lib/inch/language/elixir/roles/module.rb
inch-0.5.9 lib/inch/language/elixir/roles/module.rb
inch-0.5.8 lib/inch/language/elixir/roles/module.rb