class Portable::Data::Source

A single source of data. This is meant to serve as an interface / example implementation with the intention of being re-implemented within applications. For example, you may decide more database data sources would be better, so it could be connected to ORMs or other data adapters; all it really needs to provide is enumerables for each attribute.

Attributes

data_rows[R]
header_rows[R]
keys[R]
name[R]

Public Class Methods

new(name: '', header_rows: [], footer_rows: [], data_rows: [], keys: []) click to toggle source

Individial header and footer rows are arrays, while individual data_rows is an object like a hash, Struct, OpenStruct, or really any PORO.

# File lib/portable/data/source.rb, line 27
def initialize(name: '', header_rows: [], footer_rows: [], data_rows: [], keys: [])
  @name        = name.to_s
  @header_rows = header_rows || []
  @footer_rows = footer_rows || []
  @data_rows   = data_rows   || []
  @keys        = keys        || []

  freeze
end