Class: Rules::Parameters::Constant

Inherits:
Parameter
  • Object
show all
Defined in:
lib/rules/parameters/constant.rb

Constant Summary

Constants inherited from Parameter

Parameter::VALID_TYPES

Instance Attribute Summary collapse

Attributes inherited from Parameter

#key, #name, #type

Instance Method Summary collapse

Methods inherited from Parameter

cast, #initialize, #to_s

Constructor Details

This class inherits a constructor from Rules::Parameters::Parameter

Instance Attribute Details

#evaluation_methodObject

Returns the value of attribute evaluation_method.



5
6
7
# File 'lib/rules/parameters/constant.rb', line 5

def evaluation_method
  @evaluation_method
end

Instance Method Details

#evaluate(attributes = {}) ⇒ Object



7
8
9
10
# File 'lib/rules/parameters/constant.rb', line 7

def evaluate(attributes = {})
  raise 'Unknown evaluation method' unless evaluation_method
  evaluation_method.call
end