Class: Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/formatters/formatter.rb

Overview



Direct Known Subclasses

DefaultFormatter

Instance Method Summary collapse

Instance Method Details

#build_paragraph(input) ⇒ Object


input: An input array




17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/formatters/formatter.rb', line 17

def build_paragraph input
  paragraph = Paragraph.new
  input.each do |line|
    if line.kind_of? Hash
      line.each {|key,value| paragraph.add_link key, value}
    else
      line.gsub!(/[\r\n\t]/, '')
      if line.empty?
        next
      else
        paragraph.add_sentence line
      end
    end
  end

  paragraph
end

#do_description_format(ticket_info) ⇒ Object

Both parameters are array input from the parser of either string or hash which contains the link ticket_info: Contains :description, :solution, and :proof



10
11
12
# File 'lib/formatters/formatter.rb', line 10

def do_description_format ticket_info
  raise 'Formatter abstracion called!'
end