Class: PolicyManager::Term

Inherits:
ApplicationRecord show all
Includes:
AASM
Defined in:
app/models/policy_manager/term.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.rendererObject



26
27
28
# File 'app/models/policy_manager/term.rb', line 26

def self.renderer
  @markdown = markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
end

Instance Method Details

#ruleObject



34
35
36
# File 'app/models/policy_manager/term.rb', line 34

def rule
  PolicyManager::Config.rules.find{|o| o.name == self[:rule]}
end

#to_htmlObject



30
31
32
# File 'app/models/policy_manager/term.rb', line 30

def to_html
  self.class.renderer.render(self.description)
end