Class: DRP::Weights::ProcWeightFromCurrentDepth

Inherits:
AbstractWeight show all
Defined in:
lib/weights_and_max_depths.rb

Instance Method Summary collapse

Methods inherited from AbstractWeight

factory

Constructor Details

#initialize(args) ⇒ ProcWeightFromCurrentDepth

Returns a new instance of ProcWeightFromCurrentDepth.



253
254
255
256
# File 'lib/weights_and_max_depths.rb', line 253

def initialize args
  @rule_method = args.rule_method
  @proc = args.user_args.call @rule_method.max_depth
end

Instance Method Details

#valueObject



257
258
259
# File 'lib/weights_and_max_depths.rb', line 257

def value
  @proc.call @rule_method.depth
end