Method: Inch::Evaluation::ConstantObject#evaluate

Defined in:
lib/inch/evaluation/constant_object.rb

#evaluateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/inch/evaluation/constant_object.rb', line 6

def evaluate
  if object.has_doc?
    add_role Role::Constant::WithDoc.new(object, DOC_SCORE)
  else
    add_role Role::Constant::WithoutDoc.new(object, DOC_SCORE)
  end
  if object.nodoc?
    add_role Role::Constant::TaggedAsNodoc.new(object)
  end
  if object.has_unconsidered_tags?
    count = object.unconsidered_tags.size
    add_role Role::Object::Tagged.new(object, TAGGED_SCORE * count)
  end
  if object.in_root?
    add_role Role::Constant::InRoot.new(object)
  end
  if object.public?
    add_role Role::Constant::Public.new(object)
  end
  if object.protected?
    add_role Role::Constant::Protected.new(object)
  end
  if object.private?
    add_role Role::Constant::Private.new(object)
  end
end