Class: Fastlane::ErbalT

Inherits:
OpenStruct
  • Object
show all
Defined in:
fastlane/lib/fastlane/erb_template_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash, trim_mode = nil) ⇒ ErbalT

Returns a new instance of ErbalT.



21
22
23
24
# File 'fastlane/lib/fastlane/erb_template_helper.rb', line 21

def initialize(hash, trim_mode = nil)
  super(hash)
  @trim_mode = trim_mode
end

Instance Method Details

#render(template) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'fastlane/lib/fastlane/erb_template_helper.rb', line 26

def render(template)
  # From Ruby 2.6, ERB.new takes keyword arguments and positional ones are deprecated
  # https://bugs.ruby-lang.org/issues/14256
  if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6.0")
    ERB.new(template, trim_mode: @trim_mode).result(binding)
  else
    ERB.new(template, nil, @trim_mode).result(binding)
  end
end