class Playwright::CLI::Template

Constants

EXPANDED_TEMPLATE
EXPANDED_TYPE
InvalidTemplate
README_TEMPLATE
README_TYPE
SHELL_SCRIPT_TYPE
SIMPLE_TEMPLATE
SIMPLE_TYPE
SUBCOMMAND_TEMPLATE
SUBCOMMAND_TYPE
TEMPLATE_MAP

Attributes

out_file[R]
script_name[R]
type[R]
values[R]

Public Class Methods

new(name:, out_file:, type: SIMPLE_TYPE, klass_name: nil, values: {}) click to toggle source
# File lib/playwright/cli/template.rb, line 35
def initialize(name:, out_file:, type: SIMPLE_TYPE, klass_name: nil, values: {})
  @script_name = name
  @out_file = out_file
  @template_file = Playwright::CLI::TEMPLATES_PATH.join TEMPLATE_MAP[type]
  @klass_name = klass_name
  @values = values
end

Public Instance Methods

klass_name() click to toggle source
# File lib/playwright/cli/template.rb, line 43
def klass_name
  @klass_name || @script_name.gsub('.rb', '').split(/[A-Z\-\_\/]/).map(&:capitalize).join
end
render(*args) click to toggle source
# File lib/playwright/cli/template.rb, line 31
def render(*args)
  new(*args).render
end
val() click to toggle source
# File lib/playwright/cli/template.rb, line 54
def val
  values
end