def rewritten_source(code)
      code.gsub(/{{(.*?)}}/m) do
        old_code = $1
        if self.respond_to? old_code.split(/\.|\[/).first
          evaluated = self.instance_eval old_code
          case evaluated
          when Parser::AST::Node
            evaluated.loc.expression.source
          when Array, ArgumentsNode
            if evaluated.size > 0
              file_source = evaluated.first.loc.expression.source_buffer.source
              source = file_source[evaluated.first.loc.expression.begin_pos...evaluated.last.loc.expression.end_pos]
              lines = source.split "\n"
              lines_count = lines.length
              if lines_count > 1 && lines_count == evaluated.size
                new_code = []
                lines.each_with_index { |line, index|
                  new_code << (index == 0 ? line : line[evaluated.first.indent-2..-1])
                }
                new_code.join("\n")
              else
                source
              end
            end
          when String, Symbol
            evaluated
          when NilClass
            'nil'
          else
            raise Synvert::Core::MethodNotSupported.new "rewritten_source is not handled for #{evaluated.inspect}"
          end
        else
          "{{#{old_code}}}"
        end
      end
    end
def rewritten_source(code)
      code.gsub(/{{(.*?)}}/m) do
        old_code = $1
        if self.respond_to? old_code.split(/\.|\[/).first
          evaluated = self.instance_eval old_code
          case evaluated
          when Parser::AST::Node
            evaluated.loc.expression.source
          when Array, ArgumentsNode
            if evaluated.size > 0
              file_source = evaluated.first.loc.expression.source_buffer.source
              source = file_source[evaluated.first.loc.expression.begin_pos...evaluated.last.loc.expression.end_pos]
              lines = source.split "\n"
              lines_count = lines.length
              if lines_count > 1 && lines_count == evaluated.size
                new_code = []
                lines.each_with_index { |line, index|
                  new_code << (index == 0 ? line : line[evaluated.first.indent-2..-1])
                }
                new_code.join("\n")
              else
                source
              end
            end
          when String, Symbol
            evaluated
          when NilClass
            'nil'
          else
            raise Synvert::Core::MethodNotSupported.new "rewritten_source is not handled for #{evaluated.inspect}"
          end
        else
          "{{#{old_code}}}"
        end
      end
    end
Get rewritten source code.
 @example
   node.rewritten_source("create({{arguments}})") #=> "create(:post)"

 @param code [String] raw code.
 @return [String] rewritten code, replace string in block {{ }} in raw code.
 @raise [Synvert::Core::MethodNotSupported] if string in block {{ }} does not support.