Skip to contents

TextBlock

TextBlock

Super class

teal.reporter::ContentBlock -> TextBlock

Methods

Inherited methods


Method new()

Returns a TextBlock object.

Usage

TextBlock$new(content = character(0), style = private$styles[1])

Arguments

content

(character(1) or character(0)) a string assigned to this TextBlock

style

(character(1)) one of: "default", "header2", "header3" "verbatim"

Details

Returns a TextBlock object with no content and the default style.

Returns

TextBlock

Examples

block <- teal.reporter:::TextBlock$new()


Method set_style()

Sets the style of this TextBlock.

Usage

TextBlock$set_style(style)

Arguments

style

(character(1)) one of: "default", "header2", "header3" "verbatim"

Details

The style has bearing on the rendering of this block.

Returns

invisibly self

Examples

block <- teal.reporter:::TextBlock$new()
block$set_style("header2")


Method get_style()

Returns the style of this TextBlock.

Usage

TextBlock$get_style()

Returns

character(1) the style of this TextBlock

Examples

block <- teal.reporter:::TextBlock$new()
block$get_style()


Method get_available_styles()

Returns an array of styles available to this TextBlock.

Usage

TextBlock$get_available_styles()

Returns

a character array of styles

Examples

block <- teal.reporter:::TextBlock$new()
block$get_available_styles()


Method clone()

The objects of this class are cloneable with this method.

Usage

TextBlock$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `TextBlock$new`
## ------------------------------------------------

block <- teal.reporter:::TextBlock$new()


## ------------------------------------------------
## Method `TextBlock$set_style`
## ------------------------------------------------

block <- teal.reporter:::TextBlock$new()
block$set_style("header2")


## ------------------------------------------------
## Method `TextBlock$get_style`
## ------------------------------------------------

block <- teal.reporter:::TextBlock$new()
block$get_style()
#> [1] "default"


## ------------------------------------------------
## Method `TextBlock$get_available_styles`
## ------------------------------------------------

block <- teal.reporter:::TextBlock$new()
block$get_available_styles()
#> [1] "default"  "header2"  "header3"  "verbatim"