class GlDateConfiguration

Public Class Methods

evaluate_conditions(rows, req_gl_date, obj_gl_date) click to toggle source
# File lib/apl-library/gl_date_configuration.rb, line 14
def self.evaluate_conditions rows, req_gl_date, obj_gl_date
  rows.each do |row|
    return eval(row.result) if eval(row.condition)
  end
end
get_gl_date(params) click to toggle source
# File lib/apl-library/gl_date_configuration.rb, line 5
def self.get_gl_date params
  context = params[:context]
  req_gl_date = params[:req_gl_date]
  obj_gl_date = params[:obj_gl_date]
  rows = GlDateConfiguration.where(:context => context)
  return nil if rows.blank?
  return evaluate_conditions rows, req_gl_date, obj_gl_date
end