class Daedal::Attributes::ScoreFunctionArray
Public Instance Methods
<<(function)
click to toggle source
Calls superclass method
# File lib/daedal/attributes/score_function_array.rb, line 5 def <<(function) raise Virtus::CoercionError.new(value, 'Daedal::Attributes::ScoreFunction') unless valid_score_function?(function) super function end
unshift(function)
click to toggle source
Calls superclass method
# File lib/daedal/attributes/score_function_array.rb, line 11 def unshift(function) raise Virtus::CoercionError.new(f, 'Daedal::Attributes::ScoreFunctions') unless valid_score_function?(function) super function end
valid_score_function?(score_function)
click to toggle source
Values should be an array of hashes with filter & weight
# File lib/daedal/attributes/score_function_array.rb, line 19 def valid_score_function?(score_function) score_function[:filter].respond_to?(:hash) && score_function[:weight].respond_to?(:hash) end