module SupportMethod
Public Instance Methods
compare(arg1,arg2)
click to toggle source
# File lib/helper/support_method.rb, line 19 def compare(arg1,arg2) arg1 > arg2 end
group_result_set(result_set)
click to toggle source
# File lib/helper/support_method.rb, line 3 def group_result_set(result_set) result_set.group_by{|x| nil_check(x.parent_id) } end
level_check(value)
click to toggle source
# File lib/helper/support_method.rb, line 15 def level_check(value) value == 0 end
nil_check(value)
click to toggle source
# File lib/helper/support_method.rb, line 23 def nil_check(value) value ? value.to_i : value end
presence_check(value)
click to toggle source
# File lib/helper/support_method.rb, line 11 def presence_check(value) value.blank? end
total_calc(result_group,field_set)
click to toggle source
# File lib/helper/support_method.rb, line 7 def total_calc(result_group,field_set) result_group.sum{|x| x[field_set].to_f} end