Module: Landline::DSL::ProbeConstructors

Included in:
App, ProcessorContext, TemplateContext
Defined in:
lib/landline/dsl/constructors_probe.rb

Overview

Probe (and subclasses) DSL construct

Instance Method Summary collapse

Instance Method Details

#erb(input, vars = {}) ⇒ Object

(in Landline::Probe context) Create a new erb template

See Also:

  • Template#new


10
11
12
13
14
15
# File 'lib/landline/dsl/constructors_probe.rb', line 10

def erb(input, vars = {})
  Landline::Templates::ERB.new(input,
                               vars,
                               parent: @origin,
                               filename: caller_locations[0].path)
end

#erubi(input, vars = {}, freeze: true, capture: false) ⇒ Object

(in Landline::Probe context) Create a new erb template using Erubi engine

Parameters:

  • freeze (Boolean) (defaults to: true)

    whether to use frozen string literal

  • capture (Boolean) (defaults to: false)

    whether to enable output capturing

See Also:

  • Template#new


22
23
24
25
26
27
28
29
# File 'lib/landline/dsl/constructors_probe.rb', line 22

def erubi(input, vars = {}, freeze: true, capture: false)
  Landline::Templates::Erubi.new(input,
                                 vars,
                                 parent: @origin,
                                 freeze: freeze,
                                 capture: capture,
                                 filename: caller_locations[0].path)
end