Skip to contents

This R6 class controls one row of the Changelog table that documents the date, version, reason and what changed in the update on the document. It uses the ChangelogTableRow class to manage the different rows in the table, and control the checks

Public fields

rows

List where new rows are added

Methods


Method add_row()

Takes an object of class ChangelogTableRow. as input and adds it to the list of rows.

Usage

ChangelogTable$add_row(changelog_table_row_object)

Arguments

changelog_table_row_object

object of class ChangelogTableRow

Examples

ctr <- ChangelogTableRow$new(
 date = '01-Oct-2024',
 version = 'Initial version',
 why_update = 'Create first version of the document',
 what_changed = 'Document creation')

changelog_table <- ChangelogTable$new()
changelog_table$add_row(ctr)


Method to_dataframe()

Create a dataframe from all the rows in the row

Usage

ChangelogTable$to_dataframe()

Examples

ctr <- ChangelogTableRow$new(
 date = '01-Oct-2024',
 version = 'Initial version',
 why_update = 'Create first versoin of the document',
 what_changed = 'Document creation')

changelog_table <- ChangelogTable$new()
changelog_table$add_row(ctr)
changelog_table$to_dataframe()


Method get_table()

Generates the changelog table usin to_dataframe()

Usage

ChangelogTable$get_table()

Examples

ctr_1 <- ChangelogTableRow$new(
 date = '01-Oct-2024',
 version = 'Initial version',
 why_update = 'Create first versoin of the document',
 what_changed = 'Document creation')

 ctr_2 <- ChangelogTableRow$new(
 date = '15-Oct-2024',
 version = 'Final version',
 why_update = 'Change calculation of param 1',
 what_changed = 'Section 2')

changelog_table <- ChangelogTable$new()
changelog_table$add_row(ctr_1)
changelog_table$add_row(ctr_2)
changelog_table$get_table()


Method clone()

The objects of this class are cloneable with this method.

Usage

ChangelogTable$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `ChangelogTable$add_row`
## ------------------------------------------------

ctr <- ChangelogTableRow$new(
 date = '01-Oct-2024',
 version = 'Initial version',
 why_update = 'Create first version of the document',
 what_changed = 'Document creation')

changelog_table <- ChangelogTable$new()
changelog_table$add_row(ctr)


## ------------------------------------------------
## Method `ChangelogTable$to_dataframe`
## ------------------------------------------------

ctr <- ChangelogTableRow$new(
 date = '01-Oct-2024',
 version = 'Initial version',
 why_update = 'Create first versoin of the document',
 what_changed = 'Document creation')

changelog_table <- ChangelogTable$new()
changelog_table$add_row(ctr)
changelog_table$to_dataframe()
#>          Date         Version                    Why we changed it
#> 1 01-Oct-2024 Initial version Create first versoin of the document
#>        What changed
#> 1 Document creation


## ------------------------------------------------
## Method `ChangelogTable$get_table`
## ------------------------------------------------

ctr_1 <- ChangelogTableRow$new(
 date = '01-Oct-2024',
 version = 'Initial version',
 why_update = 'Create first versoin of the document',
 what_changed = 'Document creation')

 ctr_2 <- ChangelogTableRow$new(
 date = '15-Oct-2024',
 version = 'Final version',
 why_update = 'Change calculation of param 1',
 what_changed = 'Section 2')

changelog_table <- ChangelogTable$new()
changelog_table$add_row(ctr_1)
changelog_table$add_row(ctr_2)
changelog_table$get_table()

Date

Version

Why we changed it

What changed

01-Oct-2024

Initial version

Create first versoin of the document

Document creation

15-Oct-2024

Final version

Change calculation of param 1

Section 2