Class: Braai::Handlers::Conditional

Inherits:
Base
  • Object
show all
Includes:
Braai::Helpers
Defined in:
lib/braai/handlers/conditional.rb

Instance Attribute Summary

Attributes inherited from Base

#key, #matches, #template

Instance Method Summary collapse

Methods included from Braai::Helpers

#resolve_variable_chain_value

Methods inherited from Base

call, #initialize, #rescue_from_error, #safe_perform

Constructor Details

This class inherits a constructor from Braai::Handlers::Base

Instance Method Details

#performObject



5
6
7
8
9
10
11
12
# File 'lib/braai/handlers/conditional.rb', line 5

def perform
  res = resolve_variable_chain_value(matches[1])
  if res && res != ""
    Braai::Context.new(matches[2], template, template.attributes).render
  else
    ""
  end
end