Class: WhatsupGithub::YAMLFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsup_github/yaml_formatter.rb

Overview

Table containing Rows

Instance Method Summary collapse

Instance Method Details

#generate_output_from(content) ⇒ Object

def initialize(since)

@collector = RowCollector.new(since: since)

end



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/whatsup_github/yaml_formatter.rb', line 11

def generate_output_from(content)
  entries =
    content.collect do |object|
      {
        'description' => object.description,
        'versions' => object.versions,
        'type' => object.type,
        'date' => object.date,
        'link' => object.link,
        'merge_commit' => object.merge_commit,
        'contributor' => object.author,
        'membership' => object.membership,
        'labels' => object.labels
      }
    end
  output =
    {
      'updated' => Time.now.strftime('%c').tr_s(' ', ' '),
      'entries' => entries
    }
  output.to_yaml
end