Class: Spandx::Cli::Printer

Inherits:
Object
  • Object
show all
Extended by:
Spandx::Core::Registerable
Defined in:
lib/spandx/cli/printer.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Spandx::Core::Registerable

all, each, inherited, registry

Class Method Details

.for(format) ⇒ Object



21
22
23
# File 'lib/spandx/cli/printer.rb', line 21

def for(format)
  find { |x| x.match?(format) } || new
end

Instance Method Details

#match?(_format) ⇒ Boolean

Returns:

  • (Boolean)

Raises:



6
7
8
# File 'lib/spandx/cli/printer.rb', line 6

def match?(_format)
  raise ::Spandx::Error, :match?
end


16
# File 'lib/spandx/cli/printer.rb', line 16

def print_footer(io); end


10
# File 'lib/spandx/cli/printer.rb', line 10

def print_header(io); end


12
13
14
# File 'lib/spandx/cli/printer.rb', line 12

def print_line(dependency, io)
  io.puts(dependency.to_s)
end