# Create a bar factory.
bar_factory <- BarFactory$new()
# Get a modern bar instance.
bar <- bar_factory$get("modern")
# Check the class of the bar instance.
class(bar)
# Get a basic bar instance.
bar <- bar_factory$get("basic")
# Check the class of the bar instance.
class(bar)
Run the code above in your browser using DataLab