code: def resource(self, *urls, **kwargs):
          
          def decorator(cls):
              self.add_resource(cls, *urls, **kwargs)
              return cls
          return decorator
docs: Wraps a :class:`~flask_restful.Resource` class, adding it to the
          api. Parameters are the same as :meth:`~flask_restful.Api.add_resource`.
  
          Example::
  
              app = Flask(__name__)
              api = restful.Api(app)
  
              @api.resource('/foo')
              class Foo(Resource):
                  def get(self):
                      return 'Hello, World!'