Class: Faq

Inherits:
Object
  • Object
show all
Defined in:
app/models/faq.rb

Defined Under Namespace

Classes: QAPair, Section, Subtitle

Class Method Summary collapse

Class Method Details

.dataObject



49
# File 'app/models/faq.rb', line 49

def data; data = YAML.load_file 'db/faq.yml' end

.markdown(str) ⇒ Object



50
51
52
# File 'app/models/faq.rb', line 50

def markdown str
  RDiscount.new(str).to_html.html_safe
end

.sectionsObject



53
54
55
# File 'app/models/faq.rb', line 53

def sections
  data.map {|k,v| Faq::Section.new name: k, item: v }
end