lib/inch/evaluation/constant_object.rb in inch-0.1.4 vs lib/inch/evaluation/constant_object.rb in inch-0.2.0

- old
+ new

@@ -1,21 +1,26 @@ module Inch module Evaluation class ConstantObject < Base - DOC_SCORE = MAX_SCORE - def evaluate if object.has_doc? - add_role Role::Constant::WithDoc.new(object, DOC_SCORE) + add_role Role::Constant::WithDoc.new(object, score_for(:docstring)) else - add_role Role::Constant::WithoutDoc.new(object, DOC_SCORE) + add_role Role::Constant::WithoutDoc.new(object, score_for(:docstring)) end if object.nodoc? add_role Role::Constant::TaggedAsNodoc.new(object) end + if object.api_tag? + if object.private_api_tag? + add_role Role::Object::TaggedAsPrivateAPI.new(object) + else + add_role Role::Object::TaggedAsAPI.new(object) + end + end if object.has_unconsidered_tags? count = object.unconsidered_tags.size - add_role Role::Object::Tagged.new(object, TAGGED_SCORE * count) + add_role Role::Object::Tagged.new(object, score_for(:unconsidered_tag) * count) end if object.in_root? add_role Role::Constant::InRoot.new(object) end if object.public?