Sha256: 937e2736e215375117a9e5f56d26db1c59b2b160a621a0f2c363b96bf2dcc8d9

Contents?: true

Size: 344 Bytes

Versions: 9

Compression:

Stored size: 344 Bytes

Contents

# frozen_string_literal: true

module Spandx
  class Report
    def initialize(report: { version: '1.0', packages: [] })
      @report = report
    end

    def add(dependency)
      @report[:packages].push(dependency.to_h)
    end

    def to_h
      @report
    end

    def to_json(*_args)
      JSON.pretty_generate(to_h)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spandx-0.5.0 lib/spandx/report.rb
spandx-0.4.1 lib/spandx/report.rb
spandx-0.4.0 lib/spandx/report.rb
spandx-0.3.0 lib/spandx/report.rb
spandx-0.2.0 lib/spandx/report.rb
spandx-0.1.7 lib/spandx/report.rb
spandx-0.1.6 lib/spandx/report.rb
spandx-0.1.5 lib/spandx/report.rb
spandx-0.1.4 lib/spandx/report.rb