Sha256: cc7802a6de4a213eb2cd17a05b402f284f01dffb9150b5c72e0c1cdfb6d760ff

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

module RulesEngineHelper

  def re_plan_status re_plan
    case re_plan.plan_status
    when RePlan::PLAN_STATUS_PUBLISHED
      'published'
    when RePlan::PLAN_STATUS_CHANGED
      'changed'
    else # when RePlan::PLAN_STATUS_DRAFT
      'draft'
    end
  end    
  
  def re_plan_version re_plan
    return '' if re_plan.nil? || re_plan.plan_version.nil?
    "Ver.#{re_plan.plan_version}"    
  end
  
  def re_history_status process_status
    case process_status.to_i
    when RulesEngine::Process::PROCESS_STATUS_RUNNING
      'running'
    when RulesEngine::Process::PROCESS_STATUS_SUCCESS
      'success'
    when RulesEngine::Process::PROCESS_STATUS_FAILURE
      'error'      
    else # RulesEngine::Process::PROCESS_STATUS_NONE
      'info'
    end    
  end    

  def re_audit_status audit_status
    case audit_status.to_i
    when RulesEngine::Process::AUDIT_SUCCESS
      'success'
    when RulesEngine::Process::AUDIT_FAILURE
      'error'      
    else # RulesEngine::Process::AUDIT_INFO
      'info'
    end    
  end      
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rules_engine-0.3.3 app/helpers/rules_engine_helper.rb
rules_engine-0.3.2 app/helpers/rules_engine_helper.rb
rules_engine-0.3.1 app/helpers/rules_engine_helper.rb
rules_engine-0.3.0 app/helpers/rules_engine_helper.rb
rules_engine-0.2.0 rails_generators/templates/app/helpers/rules_engine_helper.rb