Class: FormatConcept2Doc

Inherits:
Object
  • Object
show all
Defined in:
lib/asker/exporter/doc/format_concept2doc.rb

Instance Method Summary collapse

Instance Method Details

#call(concept) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/asker/exporter/doc/format_concept2doc.rb', line 4

def call(concept)
  out = ""
  title = concept.names.join(", ")
  out << ("-" * title.size + "\n")
  out << "#{title}\n"
  concept.texts.each { |text| out << "* #{text}\n" }
  concept.images.each do |data|
    out << "* (#{data[:type]}) #{data[:url]}\n"
  end
  out << "\n"
  concept.tables.each do |table|
    out << format_table(table)
  end
  out
end