Sha256: a8cec7bb31f6293bb65a831b19bdd5fd59b6d626347fdb14ac02addd55f5e8ec

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

require 'yaml'
module WhatsupGithub
  # Table containing Rows
  class YAMLFormatter
    # def initialize(since)
    #   @collector = RowCollector.new(since: since)
    # end

    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,
            'contributor' => object.author,
            'profile' => object.author_url
          }
        end
      output =
        {
          'updated' => Time.now.strftime('%c').tr_s(' ', ' '),
          'entries' => entries
        }
      output.to_yaml
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whatsup_github-0.3.1 lib/whatsup_github/yaml-formatter.rb