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



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

def initialize(&block)
  @block = block
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object



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

def object
  @object
end

Instance Method Details

#evaluate(object) ⇒ Object



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

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