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: gate.rb
    path of file: ./repos/flipper/lib/flipper/api/v1/decorators
    
    the code of the file until where you have to start completion: module Flipper
  module Api
    module V1
      module Decorators
        class Gate
          def initialize(gate, value = nil)
            @gate
    
          def as_json(exclude_name: false)
            as_json = {
              'key' => @gate.key.to_s,
              'value' => value_as_json,
            }
            as_json['name'] = @gate.name.to_s unless exclude_name
            as_json
          end