Module: Bashly::Renderable

Included in:
Models::Base
Defined in:
lib/bashly/concerns/renderable.rb

Instance Method Summary collapse

Instance Method Details

#render(view) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/bashly/concerns/renderable.rb', line 5

def render(view)
  template = File.read view_path(view)
  # TODO: This new format is only supported in Ruby >= 2.6
  #       So for now, we keep the old deprecated syntax
  # ERB.new(template, trim_mode: '%-').result(binding)
  ERB.new(template, nil, '%-').result(binding)
end

#stringsObject



13
14
15
# File 'lib/bashly/concerns/renderable.rb', line 13

def strings
  @strings ||= MessageStrings.new
end