class Haml::HTML::ERB

def mid_block?(code)

Returns:
  • (Boolean) -

Parameters:
  • code (String) -- Ruby code to check
def mid_block?(code)
  return if valid_ruby?(code)
  valid_ruby?("if foo\n#{code}\nend") || # else, elsif
    valid_ruby?("begin\n#{code}\nend") || # rescue, ensure
    valid_ruby?("case foo\n#{code}\nend") # when
end