insert_methods: Insert Methods

Description Usage Arguments Value

View source: R/insert_methods.R

Description

Insert Methods

Usage

1
2
3
4
5
6
7
insert_methods(
  content,
  start_pos = 1,
  field = c("all", "public", "private"),
  method = c("both", "get", "set"),
  add_roxygen = TRUE
)

Arguments

content

Character, content of the file or a string

start_pos

Integer, position of cursor within 'content'. Number of characters before the cursor.

field

Character, fields for which to create method. May be "all", "public", "private" or name of class field. Multiple values allowed.

method

Character, methods to create. One of "both", "get", "set"

add_roxygen

Logical, whether to add roxygen description of method

Value

Character, modified content with injected methods


r6methods documentation built on March 16, 2021, 9:06 a.m.