class HighLine::TemplateRenderer

as context.
Renders an erb template taking a {Question} and a {HighLine} instance

def self.const_missing(name)

Parameters:
  • name (Symbol) -- automatically passed constant's name as Symbol
def self.const_missing(name)
  HighLine.const_get(name)
end

def initialize(template, source, highline)

def initialize(template, source, highline)
  @template = template
  @source   = source
  @highline = highline
end

def menu

Returns:
  • (Question, Menu) - {#source} attribute.
def menu
  source
end

def method_missing(method, *args)

Returns:
  • (String) - error message.
def method_missing(method, *args)
  "Method #{method} with args #{args.inspect} " \
    "is not available on #{inspect}. " \
    "Try #{methods(false).sort.inspect}"
end

def render

Returns:
  • (String) - rendered template
def render
  template.result(binding)
end