as_license()
turns an existing object into a license
. This is in contrast
with class_license()
, which builds a license
from individual properties.
Usage
as_license(x, ..., arg = caller_arg(x), call = caller_env())
Arguments
- x
The object to coerce. Must be empty or have names "name", "identifier", and/or "url", or names that can be coerced to those names via
snakecase::to_snake_case()
. Extra names are ignored. This object should describe a single license.- ...
These dots are for future extensions and must be empty.
- arg
An argument name as a string. This argument will be mentioned in error messages as the input that is at the origin of a problem.
- call
The execution environment of a currently running function, e.g.
caller_env()
. The function will be mentioned in error messages as the source of the error. See thecall
argument ofabort()
for more information.
Value
A license
as returned by class_license()
.
See also
info object
as_contact()
,
as_info()
,
as_origin()
,
class_contact()
,
class_info()
,
class_license()
,
class_origin()
Examples
as_license()
#> <rapid::license>
#> @ name : chr(0)
#> @ identifier: chr(0)
#> @ url : chr(0)
as_license(list(name = "Apache 2.0", identifier = "Apache-2.0"))
#> <rapid::license>
#> @ name : chr "Apache 2.0"
#> @ identifier: chr "Apache-2.0"
#> @ url : chr(0)