Class: SNMPTableViewer::Formatter Abstract

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

Overview

This class is abstract.

Parent class for formatters. Which take data and headings and output it in a given format.

Direct Known Subclasses

CSV, JSON, Raw, Table

Defined Under Namespace

Classes: CSV, JSON, Raw, Table

Instance Method Summary collapse

Constructor Details

#initialize(data:, headings: []) ⇒ Formatter

Create a new instance of Formatter.

Parameters:

  • data (Array<Array<#to_s>>)

    A two dimensional array containing objects in each cell (at ‘address’ data[col])

  • headings (Array<String, #to_s>) (defaults to: [])

    An array of headings for each column



11
12
13
14
# File 'lib/snmp_table_viewer/formatter.rb', line 11

def initialize(data:, headings: [])
    @headings = headings
    @data = data
end