You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: flamegraph.rb
    path of file: ./repos/singed/lib/singed
    
    the code of the file until where you have to start completion: module Singed
  class Flamegraph
    attr_accessor :profile, :filename

    def initialize(label: nil, ignore_gc: false, interval: 1000, filename: nil)
      # it's been created elsewhere, ie rbspy
      if filename
        if ignore_gc
          raise ArgumentErro
    
    def record
      return yield unless Singed.enabled?
      return yield if filename.exist? # file existing means its been captured already

      result = nil
      @profile = StackProf.run(mode: :wall, raw: true, ignore_gc: @ignore_gc, interval: @interval) do
        result = yield
      end
      result
    end