Class: Inch::Config::Evaluation::Criteria

Inherits:
Object
  • Object
show all
Extended by:
Utils::ReadWriteMethods
Defined in:
lib/inch/config/evaluation.rb

Overview

An Criteria describes how important certain parts of the docs are for the associated Object

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::ReadWriteMethods

rw_method, rw_methods

Constructor Details

#initialize(&block) ⇒ Criteria

Returns a new instance of Criteria.



46
47
48
# File 'lib/inch/config/evaluation.rb', line 46

def initialize(&block)
  @block = block
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



44
45
46
# File 'lib/inch/config/evaluation.rb', line 44

def object
  @object
end

Instance Method Details

#evaluate(object) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/inch/config/evaluation.rb', line 50

def evaluate(object)
  @object = object
  instance_eval(&@block)
  # we are "deleting" the block/Proc here because it can't be
  # serialized by Marshal
  # TODO: find a nicer way to achieve this
  @block = nil
end