Class: Inch::Config::Evaluation::Criteria
- Inherits:
-
Object
- Object
- Inch::Config::Evaluation::Criteria
- 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
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #evaluate(object) ⇒ Object
-
#initialize(&block) ⇒ Criteria
constructor
A new instance of Criteria.
Methods included from Utils::ReadWriteMethods
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
#object ⇒ Object (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 |